diff options
author | Dhandapani <dhandapani@gluster.com> | 2011-10-20 10:14:51 +0530 |
---|---|---|
committer | Dhandapani <dhandapani@gluster.com> | 2011-11-02 12:52:44 +0530 |
commit | f236e29a2affad82354385e2c81a6b27890d0ca7 (patch) | |
tree | 2840d1c5abdd70d7cc695c25fb088bdbee7fe443 | |
parent | 23256a8c5d9bdabb43960770a08015f177c5b012 (diff) | |
parent | 7e88adeca93e3a91cb94ae97dfeaaf34abeebe52 (diff) |
Merge branch 'master' of git@github.com:gluster/console
7 files changed, 26 insertions, 18 deletions
diff --git a/src/com.gluster.storage.management.client/src/com/gluster/storage/management/client/VolumesClient.java b/src/com.gluster.storage.management.client/src/com/gluster/storage/management/client/VolumesClient.java index 0e24fad0..ec8d0212 100644 --- a/src/com.gluster.storage.management.client/src/com/gluster/storage/management/client/VolumesClient.java +++ b/src/com.gluster.storage.management.client/src/com/gluster/storage/management/client/VolumesClient.java @@ -90,7 +90,7 @@ public class VolumesClient extends AbstractClient { private void performOperation(String volumeName, String operation, Boolean force) { Form form = new Form(); form.add(RESTConstants.FORM_PARAM_OPERATION, operation); - form.add(RESTConstants.FORM_PARAM_FORCE_OPTION, force); + form.add(RESTConstants.FORM_PARAM_FORCE, force); putRequest(volumeName, form); } diff --git a/src/com.gluster.storage.management.console/plugin.xml b/src/com.gluster.storage.management.console/plugin.xml index 5195b1f0..8a58a86d 100644 --- a/src/com.gluster.storage.management.console/plugin.xml +++ b/src/com.gluster.storage.management.console/plugin.xml @@ -530,7 +530,7 @@ definitionId="com.gluster.storage.management.console.commands.ForceStartVolume" icon="icons/tango/32x32/start-volume.png" id="com.gluster.storage.management.console.actions.ForceStartVolumeAction" - label="Force Start Volume" + label="Start Offline Bricks" menubarPath="com.gluster.storage.management.console.menu.volume/volume" style="push" toolbarPath="Normal" diff --git a/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/actions/MigrateBrickAction.java b/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/actions/MigrateBrickAction.java index db416c07..a8667c33 100644 --- a/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/actions/MigrateBrickAction.java +++ b/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/actions/MigrateBrickAction.java @@ -54,7 +54,11 @@ public class MigrateBrickAction extends AbstractActionDelegate { action.setEnabled(false); if (selectedEntity instanceof Brick) { bricks = GUIHelper.getInstance().getSelectedEntities(getWindow(), Brick.class); - brick = bricks.iterator().next(); + if ( bricks.iterator().hasNext()) { + brick = bricks.iterator().next(); + } else { + brick = null; + } action.setEnabled(brick != null); } } diff --git a/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/dialogs/MigrateBrickPage1.java b/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/dialogs/MigrateBrickPage1.java index dfa0b352..e3d9d2bf 100644 --- a/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/dialogs/MigrateBrickPage1.java +++ b/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/dialogs/MigrateBrickPage1.java @@ -147,18 +147,18 @@ public class MigrateBrickPage1 extends WizardPage { this.volume = volume; this.fromBrick = brick; setTitle("Migrate Brick [" + volume.getName() + "]"); - setPageDescription(null, null); + setPageDescription(fromBrick.getQualifiedName(), null); setPageComplete(false); } private void setPageDescription(String source, String target) { - if (source == null || source.equals("")) { - source = "From Brick"; + if (source == null) { + source = ""; } - if (target == null || target.equals("")) { - target = "To Brick"; + if (target == null) { + target = ""; } - setDescription("Migrate volume data from \"" + source + "\" to \"" + target + "\""); + setDescription("Migrate data from \"" + source + "\" to \"" + target + "\""); } private Object getSelectedItem(TableViewer tableViewer) { @@ -194,6 +194,9 @@ public class MigrateBrickPage1 extends WizardPage { public String getTargetBrickDir() { Device targetDevice = (Device)getSelectedItem(tableViewerTo); + if (targetDevice == null) { + return ""; + } return targetDevice.getQualifiedBrickName(volume.getName()); } @@ -290,6 +293,7 @@ public class MigrateBrickPage1 extends WizardPage { @Override public void selectionChanged(SelectionChangedEvent event) { refreshButtonStatus(); + setPageDescription(getSourceBrickDir(), getTargetBrickDir()); } }); return tableViewer; diff --git a/src/com.gluster.storage.management.core/src/com/gluster/storage/management/core/constants/RESTConstants.java b/src/com.gluster.storage.management.core/src/com/gluster/storage/management/core/constants/RESTConstants.java index e04658d7..ad0bb225 100644 --- a/src/com.gluster.storage.management.core/src/com/gluster/storage/management/core/constants/RESTConstants.java +++ b/src/com.gluster.storage.management.core/src/com/gluster/storage/management/core/constants/RESTConstants.java @@ -86,7 +86,7 @@ public class RESTConstants { public static final String FORM_PARAM_FORCED_DATA_MIGRATE = "forcedDataMigrate"; public static final String FORM_PARAM_OLD_PASSWORD = "oldPassword"; public static final String FORM_PARAM_NEW_PASSWORD = "newPassword"; - public static final String FORM_PARAM_FORCE_OPTION = "forceOperation"; + public static final String FORM_PARAM_FORCE = "forceOperation"; public static final String PATH_PARAM_FORMAT = "format"; public static final String PATH_PARAM_VOLUME_NAME = "volumeName"; diff --git a/src/com.gluster.storage.management.gateway/src/com/gluster/storage/management/gateway/resources/v1_0/VolumesResource.java b/src/com.gluster.storage.management.gateway/src/com/gluster/storage/management/gateway/resources/v1_0/VolumesResource.java index bc38469e..14e7be8c 100644 --- a/src/com.gluster.storage.management.gateway/src/com/gluster/storage/management/gateway/resources/v1_0/VolumesResource.java +++ b/src/com.gluster.storage.management.gateway/src/com/gluster/storage/management/gateway/resources/v1_0/VolumesResource.java @@ -37,7 +37,7 @@ import static com.gluster.storage.management.core.constants.RESTConstants.FORM_P import static com.gluster.storage.management.core.constants.RESTConstants.FORM_PARAM_VOLUME_NAME; import static com.gluster.storage.management.core.constants.RESTConstants.FORM_PARAM_VOLUME_OPTIONS; import static com.gluster.storage.management.core.constants.RESTConstants.FORM_PARAM_VOLUME_TYPE; -import static com.gluster.storage.management.core.constants.RESTConstants.FORM_PARAM_FORCE_OPTION; +import static com.gluster.storage.management.core.constants.RESTConstants.FORM_PARAM_FORCE; import static com.gluster.storage.management.core.constants.RESTConstants.PATH_PARAM_CLUSTER_NAME; import static com.gluster.storage.management.core.constants.RESTConstants.PATH_PARAM_VOLUME_NAME; import static com.gluster.storage.management.core.constants.RESTConstants.QUERY_PARAM_BRICKS; @@ -196,7 +196,7 @@ public class VolumesResource extends AbstractResource { @FormParam(FORM_PARAM_MIGRATE_DATA) Boolean isMigrateData, @FormParam(FORM_PARAM_FORCED_DATA_MIGRATE) Boolean isForcedDataMigrate, @FormParam(FORM_PARAM_CIFS_ENABLE) Boolean enableCifs, @FormParam(FORM_PARAM_CIFS_USERS) String cifsUsers, - @FormParam(FORM_PARAM_BRICKS) String bricks, @FormParam(FORM_PARAM_FORCE_OPTION) Boolean force) { + @FormParam(FORM_PARAM_BRICKS) String bricks, @FormParam(FORM_PARAM_FORCE) Boolean force) { if (clusterName == null || clusterName.isEmpty()) { throw new GlusterValidationException("Cluster name must not be empty!"); } diff --git a/src/com.gluster.storage.management.gateway/src/com/gluster/storage/management/gateway/services/VolumeService.java b/src/com.gluster.storage.management.gateway/src/com/gluster/storage/management/gateway/services/VolumeService.java index e44cebb5..1a86b9cd 100644 --- a/src/com.gluster.storage.management.gateway/src/com/gluster/storage/management/gateway/services/VolumeService.java +++ b/src/com.gluster.storage.management.gateway/src/com/gluster/storage/management/gateway/services/VolumeService.java @@ -708,20 +708,20 @@ public class VolumeService { } } - public void performVolumeOperation(String clusterName, String volumeName, String operation, Boolean forceOption) { + public void performVolumeOperation(String clusterName, String volumeName, String operation, Boolean force) { GlusterServer onlineServer = clusterService.getOnlineServer(clusterName); try { if (onlineServer == null) { throw new GlusterRuntimeException("No online servers found in cluster [" + clusterName + "]"); } - performOperation(clusterName, volumeName, operation, onlineServer, forceOption); + performOperation(clusterName, volumeName, operation, onlineServer, force); } catch (Exception e) { // check if online server has gone offline. If yes, try again one more time. if (e instanceof ConnectionException || serverUtil.isServerOnline(onlineServer) == false) { // online server has gone offline! try with a different one. onlineServer = clusterService.getNewOnlineServer(clusterName); - performOperation(clusterName, volumeName, operation, onlineServer, forceOption); + performOperation(clusterName, volumeName, operation, onlineServer, force); } else { throw new GlusterRuntimeException(e.getMessage()); } @@ -729,7 +729,7 @@ public class VolumeService { } private void performOperation(String clusterName, String volumeName, String operation, GlusterServer onlineServer, - Boolean forceOption) { + Boolean force) { Volume volume = null; try { volume = getVolume(clusterName, volumeName); @@ -739,9 +739,9 @@ public class VolumeService { } if (operation.equals(TASK_START)) { - startVolume(clusterName, onlineServer, volume, forceOption); + startVolume(clusterName, onlineServer, volume, force); } else if (operation.equals(TASK_STOP)) { - stopVolume(clusterName, onlineServer, volume, forceOption); + stopVolume(clusterName, onlineServer, volume, force); } else { throw new GlusterValidationException("Invalid operation code [" + operation + "]"); } |