diff options
| author | Selvasundaram <selvam@gluster.com> | 2011-08-17 15:24:46 +0530 |
|---|---|---|
| committer | Selvasundaram <selvam@gluster.com> | 2011-08-17 15:24:46 +0530 |
| commit | 541ee69293c434ded70f26027b48352b560aba0a (patch) | |
| tree | 85e8d58d812385086766df1fccd7343b5ed8c763 | |
| parent | add2c0417ccb9ecd94e733381c7575209308c2cc (diff) | |
| parent | 3a082258c516c82c4208b00b5307be35a468cd51 (diff) | |
Merge branch 'master' of github.com:gluster/console
24 files changed, 114 insertions, 28 deletions
diff --git a/src/com.gluster.storage.management.client/src/com/gluster/storage/management/client/constants/ClientConstants.java b/src/com.gluster.storage.management.client/src/com/gluster/storage/management/client/constants/ClientConstants.java index 765735fb..e253dfa5 100644 --- a/src/com.gluster.storage.management.client/src/com/gluster/storage/management/client/constants/ClientConstants.java +++ b/src/com.gluster.storage.management.client/src/com/gluster/storage/management/client/constants/ClientConstants.java @@ -27,7 +27,7 @@ public class ClientConstants { public static final String SYS_PROP_SERVER_URL = "gluster.server.url"; public static final String DEFAULT_SERVER_URL = "https://localhost:8443/glustermg/linux.gtk.x86_64"; public static final String CONTEXT_ROOT = "glustermg"; - public static final String REST_API_VERSION = "1.0"; + public static final String REST_API_VERSION = "1.0.0"; // SSL related public static final String TRUSTED_KEYSTORE = "gmc-trusted.keystore"; diff --git a/src/com.gluster.storage.management.console/plugin.properties b/src/com.gluster.storage.management.console/plugin.properties index 6a93e73d..4ef7da70 100644 --- a/src/com.gluster.storage.management.console/plugin.properties +++ b/src/com.gluster.storage.management.console/plugin.properties @@ -3,4 +3,5 @@ Version: 1.0.0\n\n\ Copyright (c) 2011 Gluster, Inc.\n\ Visit http://www.gluster.com/\n\n\ This product includes software developed by the\n\ -Eclipse Foundation http://eclipse.org/
\ No newline at end of file +Eclipse Foundation http://eclipse.org/\n\ +RichClientGUI http://www.richclientgui.com/
\ No newline at end of file diff --git a/src/com.gluster.storage.management.console/plugin.xml b/src/com.gluster.storage.management.console/plugin.xml index 675b7e52..9cadd537 100644 --- a/src/com.gluster.storage.management.console/plugin.xml +++ b/src/com.gluster.storage.management.console/plugin.xml @@ -175,15 +175,6 @@ name="Tasks" restorable="true"> </view> - <view - allowMultiple="false" - category="com.gluster.storage.management.console.category" - class="org.eclipse.tm.internal.terminal.view.TerminalView" - icon="icons/tango/16x16/utilities-terminal.png" - id="com.gluster.storage.management.console.views.TerminalView" - name="Terminal" - restorable="true"> - </view> </extension> <extension point="org.eclipse.ui.commands"> @@ -1419,7 +1410,7 @@ </view> <view closeable="true" - id="com.gluster.storage.management.console.views.TerminalView" + id="org.eclipse.tm.terminal.view.TerminalView" minimized="false" moveable="false" ratio="0.60f" diff --git a/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/views/TerminalView.java b/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/ConsoleConstants.java index d99ac513..9dce2539 100644 --- a/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/views/TerminalView.java +++ b/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/ConsoleConstants.java @@ -16,11 +16,11 @@ * along with this program. If not, see * <http://www.gnu.org/licenses/>. *******************************************************************************/ -package com.gluster.storage.management.console.views; +package com.gluster.storage.management.console; /** - * + * */ -public class TerminalView extends org.eclipse.tm.internal.terminal.view.TerminalView { - public static final String ID = TerminalView.class.getName(); +public class ConsoleConstants { + public static final String TERMINAL_VIEW_ID = "org.eclipse.tm.terminal.view.TerminalView"; } diff --git a/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/dialogs/CreateVolumePage1.java b/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/dialogs/CreateVolumePage1.java index 49946668..d7d98d24 100644 --- a/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/dialogs/CreateVolumePage1.java +++ b/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/dialogs/CreateVolumePage1.java @@ -408,9 +408,9 @@ public class CreateVolumePage1 extends WizardPage { VOLUME_TYPE volumeType = (VOLUME_TYPE) ((IStructuredSelection) typeComboViewer .getSelection()).getFirstElement(); - if (volumeType == VOLUME_TYPE.DISTRIBUTED_REPLICATE && diskCount % 2 != 0) { + if ((volumeType == VOLUME_TYPE.DISTRIBUTED_REPLICATE || volumeType == VOLUME_TYPE.REPLICATE ) && diskCount % 2 != 0) { setError("Mirror type volume requires bricks in multiples of two"); - } else if (volumeType == VOLUME_TYPE.DISTRIBUTED_STRIPE && diskCount % 4 != 0) { + } else if ((volumeType == VOLUME_TYPE.DISTRIBUTED_STRIPE || volumeType == VOLUME_TYPE.STRIPE) && diskCount % 4 != 0) { setError("Stripe type volume requires bricks in multiples of four"); } } diff --git a/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/utils/GUIHelper.java b/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/utils/GUIHelper.java index 841d5a9d..f46f9ddf 100644 --- a/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/utils/GUIHelper.java +++ b/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/utils/GUIHelper.java @@ -80,11 +80,11 @@ import org.eclipse.ui.forms.widgets.Section; import org.eclipse.ui.progress.IProgressConstants; import com.gluster.storage.management.console.Application; +import com.gluster.storage.management.console.ConsoleConstants; import com.gluster.storage.management.console.GlusterDataModelManager; import com.gluster.storage.management.console.IImageKeys; import com.gluster.storage.management.console.views.NavigationView; import com.gluster.storage.management.console.views.TasksView; -import com.gluster.storage.management.console.views.TerminalView; import com.gluster.storage.management.core.exceptions.GlusterRuntimeException; import com.gluster.storage.management.core.model.Disk; import com.gluster.storage.management.core.utils.JavaUtil; @@ -460,8 +460,7 @@ public class GUIHelper { } public void showTerminalView() { - //showView("org.eclipse.tm.terminal.view.TerminalView"); - showView(TerminalView.ID); + showView(ConsoleConstants.TERMINAL_VIEW_ID); } public void showProgressView() { diff --git a/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/views/GlusterViewsManager.java b/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/views/GlusterViewsManager.java index 928bc7fc..05c30626 100644 --- a/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/views/GlusterViewsManager.java +++ b/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/views/GlusterViewsManager.java @@ -24,6 +24,7 @@ import org.eclipse.ui.IViewReference; import org.eclipse.ui.IWorkbenchPage; import org.eclipse.ui.PartInitException; +import com.gluster.storage.management.console.ConsoleConstants; import com.gluster.storage.management.core.model.Cluster; import com.gluster.storage.management.core.model.Entity; import com.gluster.storage.management.core.model.EntityGroup; @@ -44,6 +45,7 @@ public class GlusterViewsManager implements ViewsManager { /* (non-Javadoc) * @see com.gluster.storage.management.console.views.ViewsManager#updateViews(com.gluster.storage.management.core.model.Entity) */ + @SuppressWarnings("rawtypes") @Override public void updateViews(Entity entity) { closeAllViews(); @@ -65,13 +67,11 @@ public class GlusterViewsManager implements ViewsManager { } } - /** - * - */ private void closeAllViews() { IViewReference[] viewReferences = page.getViewReferences(); for (final IViewReference viewReference : viewReferences) { - if (!(viewReference.getId().equals(NavigationView.ID) || viewReference.getId().equals(TerminalView.ID))) { + if (!(viewReference.getId().equals(NavigationView.ID) || viewReference.getId().equals( + ConsoleConstants.TERMINAL_VIEW_ID))) { page.hideView(viewReference); } } @@ -80,7 +80,6 @@ public class GlusterViewsManager implements ViewsManager { private void showViewsForCluster(Cluster cluster) throws PartInitException { page.showView(ClusterSummaryView.ID); page.showView(TasksView.ID, null, IWorkbenchPage.VIEW_CREATE); - //page.showView("org.eclipse.tm.terminal.view.TerminalView", null, IWorkbenchPage.VIEW_CREATE); } private void showViewsForVolume(Volume volume) throws PartInitException { diff --git a/src/com.gluster.storage.management.gateway.scripts/src/gateway/remove_server_volume_cifs_config.py b/src/com.gluster.storage.management.gateway.scripts/src/gateway/remove_server_volume_cifs_config.py new file mode 100755 index 00000000..efdb9b1c --- /dev/null +++ b/src/com.gluster.storage.management.gateway.scripts/src/gateway/remove_server_volume_cifs_config.py @@ -0,0 +1,83 @@ +#!/usr/bin/python +# Copyright (C) 2011 Gluster, Inc. <http://www.gluster.com> +# This file is part of Gluster Management Gateway. +# + +import os +import sys +p1 = os.path.abspath(os.path.dirname(sys.argv[0])) +p2 = "%s/common" % os.path.dirname(p1) +if not p1 in sys.path: + sys.path.append(p1) +if not p2 in sys.path: + sys.path.append(p2) +import Globals +import Utils + + +def main(): + if len(sys.argv) < 3: + sys.stderr.write("usage: %s SERVER_NAME VOLUME_FILE\n" % os.path.basename(sys.argv[0])) + sys.exit(-1) + + serverName = sys.argv[1] + volumeFile = sys.argv[2] + + try: + fp = open(volumeFile) + lines = fp.readlines() + fp.close() + except IOError, e: + Utils.log("Failed to read volume file %s: %s" % (volumeFile, str(e))) + sys.stderr.write("Failed to read volume file %s: %s\n" % (volumeFile, str(e))) + sys.exit(1) + + volumeNameList = [line.strip() for line in lines] + if not volumeNameList: + sys.exit(0) + + try: + fp = open(Globals.CIFS_VOLUME_FILE) + content = fp.read() + fp.close() + except IOError, e: + Utils.log("failed to read file %s: %s" % (Globals.CIFS_VOLUME_FILE, str(e))) + sys.stderr.write("failed to read file %s: %s\n" % (Globals.CIFS_VOLUME_FILE, str(e))) + sys.exit(2) + + cifsVolumeList = [line.split(":")[0] for line in content.split()] + runningCifsVolumeList = set(cifsVolumeList).intersection(set(volumeNameList)) + + if not runningCifsVolumeList: + sys.exit(0) + + tempFileName = Utils.getTempFileName() + try: + fp = open(tempFileName, "w") + fp.write("%s\n" % serverName) + except IOError: + Utils.log("Failed to write server name to file %s" % tempFileName) + sys.stderr.write("Failed to write server name to file\n") + sys.exit(3) + + status = True + for volumeName in runningCifsVolumeList: + if Utils.runCommand(["grun.py", tempFileName, "stop_volume_cifs.py", volumeName.strip()]) != 0: + status = False + if Utils.runCommand(["grun.py", tempFileName, "delete_volume_cifs.py", volumeName.strip()]) ! 0: + status = False + + try: + os.remove(tempFileName) + except OSError, e: + Utils.log("Failed to remove temporary file %s" % tempFileName) + sys.stderr.write("Failed to remove temporary file %s\n" % tempFileName) + pass + + if status: + sys.exit(0) + else: + sys.exit(2) + +if __name__ == "__main__": + main() diff --git a/src/com.gluster.storage.management.gateway/WebContent/WEB-INF/web.xml b/src/com.gluster.storage.management.gateway/WebContent/WEB-INF/web.xml index 631788ff..54872639 100644 --- a/src/com.gluster.storage.management.gateway/WebContent/WEB-INF/web.xml +++ b/src/com.gluster.storage.management.gateway/WebContent/WEB-INF/web.xml @@ -37,7 +37,7 @@ </servlet> <servlet-mapping> <servlet-name>gluster-resources-1.0</servlet-name> - <url-pattern>/1.0/*</url-pattern> + <url-pattern>/1.0.0/*</url-pattern> </servlet-mapping> <servlet> <servlet-name>JnlpDownloadServlet</servlet-name> diff --git a/src/com.gluster.storage.management.gateway/WebContent/scripts/Globals.py b/src/com.gluster.storage.management.gateway/WebContent/scripts/Globals.py new file mode 120000 index 00000000..7d230498 --- /dev/null +++ b/src/com.gluster.storage.management.gateway/WebContent/scripts/Globals.py @@ -0,0 +1 @@ +../../../com.gluster.storage.management.gateway.scripts/src/common/Globals.py
\ No newline at end of file diff --git a/src/com.gluster.storage.management.gateway/WebContent/scripts/Protocol.py b/src/com.gluster.storage.management.gateway/WebContent/scripts/Protocol.py new file mode 120000 index 00000000..7ecad84d --- /dev/null +++ b/src/com.gluster.storage.management.gateway/WebContent/scripts/Protocol.py @@ -0,0 +1 @@ +../../../com.gluster.storage.management.gateway.scripts/src/common/Protocol.py
\ No newline at end of file diff --git a/src/com.gluster.storage.management.gateway/WebContent/scripts/Utils.py b/src/com.gluster.storage.management.gateway/WebContent/scripts/Utils.py new file mode 120000 index 00000000..df26ff44 --- /dev/null +++ b/src/com.gluster.storage.management.gateway/WebContent/scripts/Utils.py @@ -0,0 +1 @@ +../../../com.gluster.storage.management.gateway.scripts/src/common/Utils.py
\ No newline at end of file diff --git a/src/com.gluster.storage.management.gateway/WebContent/scripts/XmlHandler.py b/src/com.gluster.storage.management.gateway/WebContent/scripts/XmlHandler.py new file mode 120000 index 00000000..880349a1 --- /dev/null +++ b/src/com.gluster.storage.management.gateway/WebContent/scripts/XmlHandler.py @@ -0,0 +1 @@ +../../../com.gluster.storage.management.gateway.scripts/src/common/XmlHandler.py
\ No newline at end of file diff --git a/src/com.gluster.storage.management.gateway/WebContent/scripts/add_user_cifs_all.py b/src/com.gluster.storage.management.gateway/WebContent/scripts/add_user_cifs_all.py new file mode 120000 index 00000000..fec57917 --- /dev/null +++ b/src/com.gluster.storage.management.gateway/WebContent/scripts/add_user_cifs_all.py @@ -0,0 +1 @@ +../../../com.gluster.storage.management.gateway.scripts/src/gateway/add_user_cifs_all.py
\ No newline at end of file diff --git a/src/com.gluster.storage.management.gateway/WebContent/scripts/create_volume_cifs_all.py b/src/com.gluster.storage.management.gateway/WebContent/scripts/create_volume_cifs_all.py new file mode 120000 index 00000000..03752d57 --- /dev/null +++ b/src/com.gluster.storage.management.gateway/WebContent/scripts/create_volume_cifs_all.py @@ -0,0 +1 @@ +../../../com.gluster.storage.management.gateway.scripts/src/gateway/create_volume_cifs_all.py
\ No newline at end of file diff --git a/src/com.gluster.storage.management.gateway/WebContent/scripts/delete_user_cifs_all.py b/src/com.gluster.storage.management.gateway/WebContent/scripts/delete_user_cifs_all.py new file mode 120000 index 00000000..d517e46c --- /dev/null +++ b/src/com.gluster.storage.management.gateway/WebContent/scripts/delete_user_cifs_all.py @@ -0,0 +1 @@ +../../../com.gluster.storage.management.gateway.scripts/src/gateway/delete_user_cifs_all.py
\ No newline at end of file diff --git a/src/com.gluster.storage.management.gateway/WebContent/scripts/delete_volume_cifs_all.py b/src/com.gluster.storage.management.gateway/WebContent/scripts/delete_volume_cifs_all.py new file mode 120000 index 00000000..be9e627c --- /dev/null +++ b/src/com.gluster.storage.management.gateway/WebContent/scripts/delete_volume_cifs_all.py @@ -0,0 +1 @@ +../../../com.gluster.storage.management.gateway.scripts/src/gateway/delete_volume_cifs_all.py
\ No newline at end of file diff --git a/src/com.gluster.storage.management.gateway/WebContent/scripts/get_volume_user_cifs.py b/src/com.gluster.storage.management.gateway/WebContent/scripts/get_volume_user_cifs.py new file mode 120000 index 00000000..3eff03fd --- /dev/null +++ b/src/com.gluster.storage.management.gateway/WebContent/scripts/get_volume_user_cifs.py @@ -0,0 +1 @@ +../../../com.gluster.storage.management.gateway.scripts/src/gateway/get_volume_user_cifs.py
\ No newline at end of file diff --git a/src/com.gluster.storage.management.gateway/WebContent/scripts/gmg-reset-password.sh b/src/com.gluster.storage.management.gateway/WebContent/scripts/gmg-reset-password.sh new file mode 120000 index 00000000..13b9a40b --- /dev/null +++ b/src/com.gluster.storage.management.gateway/WebContent/scripts/gmg-reset-password.sh @@ -0,0 +1 @@ +../../../com.gluster.storage.management.gateway.scripts/src/gateway/gmg-reset-password.sh
\ No newline at end of file diff --git a/src/com.gluster.storage.management.gateway/WebContent/scripts/grun.py b/src/com.gluster.storage.management.gateway/WebContent/scripts/grun.py new file mode 120000 index 00000000..5e56bfbb --- /dev/null +++ b/src/com.gluster.storage.management.gateway/WebContent/scripts/grun.py @@ -0,0 +1 @@ +../../../com.gluster.storage.management.gateway.scripts/src/gateway/grun.py
\ No newline at end of file diff --git a/src/com.gluster.storage.management.gateway/WebContent/scripts/multicast-discover-servers.py b/src/com.gluster.storage.management.gateway/WebContent/scripts/multicast-discover-servers.py new file mode 120000 index 00000000..6288f182 --- /dev/null +++ b/src/com.gluster.storage.management.gateway/WebContent/scripts/multicast-discover-servers.py @@ -0,0 +1 @@ +../../../com.gluster.storage.management.gateway.scripts/src/gateway/multicast-discover-servers.py
\ No newline at end of file diff --git a/src/com.gluster.storage.management.gateway/WebContent/scripts/setup_cifs_config_all.py b/src/com.gluster.storage.management.gateway/WebContent/scripts/setup_cifs_config_all.py new file mode 120000 index 00000000..e3f44800 --- /dev/null +++ b/src/com.gluster.storage.management.gateway/WebContent/scripts/setup_cifs_config_all.py @@ -0,0 +1 @@ +../../../com.gluster.storage.management.gateway.scripts/src/gateway/setup_cifs_config_all.py
\ No newline at end of file diff --git a/src/com.gluster.storage.management.gateway/WebContent/scripts/update_volume_cifs_all.py b/src/com.gluster.storage.management.gateway/WebContent/scripts/update_volume_cifs_all.py new file mode 120000 index 00000000..8496fae4 --- /dev/null +++ b/src/com.gluster.storage.management.gateway/WebContent/scripts/update_volume_cifs_all.py @@ -0,0 +1 @@ +../../../com.gluster.storage.management.gateway.scripts/src/gateway/update_volume_cifs_all.py
\ No newline at end of file diff --git a/src/com.gluster.storage.management.gateway/src/com/gluster/storage/management/gateway/constants/VolumeOptionsDefaults.java b/src/com.gluster.storage.management.gateway/src/com/gluster/storage/management/gateway/constants/VolumeOptionsDefaults.java index 892ebf11..508a3029 100644 --- a/src/com.gluster.storage.management.gateway/src/com/gluster/storage/management/gateway/constants/VolumeOptionsDefaults.java +++ b/src/com.gluster.storage.management.gateway/src/com/gluster/storage/management/gateway/constants/VolumeOptionsDefaults.java @@ -30,7 +30,6 @@ import com.gluster.storage.management.core.constants.CoreConstants; import com.gluster.storage.management.core.exceptions.ConnectionException; import com.gluster.storage.management.core.exceptions.GlusterRuntimeException; import com.gluster.storage.management.core.model.GlusterServer; -import com.gluster.storage.management.core.model.Status; import com.gluster.storage.management.core.model.VolumeOptionInfo; import com.gluster.storage.management.core.response.VolumeOptionInfoListResponse; import com.gluster.storage.management.gateway.services.ClusterService; |
