Hello Alon Bar-Lev, I'd like you to do a code review. Please visit
http://gerrit.ovirt.org/17736 to review the following change. Change subject: packaging: setup: Do not enable Gluster in Default cluster ...................................................................... packaging: setup: Do not enable Gluster in Default cluster DEFAULT cluster is created during installation of engine. If Application mode is selected as BOTH during installation, DEFAULT cluster will be created with both Gluster and Virt enabled by default. By default only virt will be enabled in DEFAULT cluster. (cherry picked from commit 62d8878e7d3233bfb2dac861262efba24b428ccf) Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=988453 Change-Id: Ic8b4d15689c730428aad09dd0c981faf5732731d Signed-off-by: Aravinda VK <avish...@redhat.com> Signed-off-by: Alon Bar-Lev <alo...@redhat.com> --- M packaging/fedora/setup/engine-setup.py M packaging/setup/plugins/ovirt-engine-setup/config/appmode.py 2 files changed, 27 insertions(+), 12 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/36/17736/1 diff --git a/packaging/fedora/setup/engine-setup.py b/packaging/fedora/setup/engine-setup.py index 0478d7b..2e48c4d 100755 --- a/packaging/fedora/setup/engine-setup.py +++ b/packaging/fedora/setup/engine-setup.py @@ -1111,12 +1111,11 @@ def _setApplicationMode(): virtService = 'true' - glusterService = 'true' + glusterService = 'false' if controller.CONF["APPLICATION_MODE"].upper() == "GLUSTER": virtService = 'false' - elif controller.CONF["APPLICATION_MODE"].upper() == "VIRT": - glusterService = 'false' + glusterService = 'true' # Update default cluster group service types, since default value of gluster_service # column is false. diff --git a/packaging/setup/plugins/ovirt-engine-setup/config/appmode.py b/packaging/setup/plugins/ovirt-engine-setup/config/appmode.py index b7dab28..a12a9a9 100644 --- a/packaging/setup/plugins/ovirt-engine-setup/config/appmode.py +++ b/packaging/setup/plugins/ovirt-engine-setup/config/appmode.py @@ -34,6 +34,10 @@ class Plugin(plugin.PluginBase): """Application mode plugin.""" + class ApplicationMode(object): + VirtOnly = 1 + GlusterOnly = 2 + def __init__(self, context): super(Plugin, self).__init__(context=context) self._enabled = False @@ -89,14 +93,8 @@ condition=lambda self: self._enabled, ) def _misc(self): - virt = gluster = False + v = self.environment[osetupcons.ConfigEnv.APPLICATION_MODE] - if v == 'both': - virt = gluster = True - elif v == 'virt': - virt = True - elif v == 'gluster': - gluster = True self.environment[osetupcons.DBEnv.STATEMENT].execute( statement=""" @@ -108,10 +106,28 @@ """, args=dict( clusterid=osetupcons.Const.DEFAULT_CLUSTER_ID, - virt=virt, - gluster=gluster, + virt=(v in ('both', 'virt')), + gluster=(v == 'gluster'), ), ) + if v != 'both': + self.environment[osetupcons.DBEnv.STATEMENT].execute( + statement=""" + select fn_db_update_config_value( + 'ApplicationMode', + %(mode)s, + 'general' + ) + """, + args=dict( + mode=str( + self.ApplicationMode.GlusterOnly + if v == 'gluster' + else self.ApplicationMode.VirtOnly + ), + ), + ) + # vim: expandtab tabstop=4 shiftwidth=4 -- To view, visit http://gerrit.ovirt.org/17736 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic8b4d15689c730428aad09dd0c981faf5732731d Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: ovirt-engine-3.3 Gerrit-Owner: Aravinda VK <avish...@redhat.com> Gerrit-Reviewer: Alon Bar-Lev <alo...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches