Change in vdsm[master]: tool: change in configurators import.

mtayer at redhat.com mtayer at redhat.com
Mon Jan 12 16:42:30 UTC 2015


mooli tayer has uploaded a new change for review.

Change subject: tool: change in configurators import.
......................................................................

tool: change in configurators import.

Change-Id: Icf1fed96d61e0a6ca06af9956b0a071c8ccdc847
Signed-off-by: Mooli Tayer <mtayer at redhat.com>
---
M lib/vdsm/tool/configurator.py
1 file changed, 12 insertions(+), 14 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/13/36813/1

diff --git a/lib/vdsm/tool/configurator.py b/lib/vdsm/tool/configurator.py
index 3380170..7b033d6 100644
--- a/lib/vdsm/tool/configurator.py
+++ b/lib/vdsm/tool/configurator.py
@@ -39,11 +39,7 @@
     expose, \
     UsageError, \
     requiresRoot
-from .configurators import \
-    YES, \
-    InvalidConfig, \
-    InvalidRun, \
-    NO
+from . import configurators
 
 
 def _import_module(abspkg, mname):
@@ -114,7 +110,7 @@
 
     Note: after configure isconfigured should return MAYBE or YES.
     """
-    return getattr(module, 'isconfigured', lambda: NO)()
+    return getattr(module, 'isconfigured', lambda: configurators.NO)()
 
 
 def _removeConf(module):
@@ -136,12 +132,12 @@
     sys.stdout.write("\nChecking configuration status...\n\n")
     for c in args.modules:
         isconfigured = _isconfigured(c)
-        override = args.force and isconfigured != YES
+        override = args.force and isconfigured != configurators.YES
         if not override and not _validate(c):
-            raise InvalidConfig(
+            raise configurators.InvalidConfig(
                 "Configuration of %s is invalid" % c.name
             )
-        if override or isconfigured == NO:
+        if override or isconfigured == configurators.NO:
             configurer_to_trigger.append(c)
 
     services = []
@@ -149,7 +145,7 @@
         for s in _getservices(c):
             if service.service_status(s, False) == 0:
                 if not args.force:
-                    raise InvalidRun(
+                    raise configurators.InvalidRun(
                         "\n\nCannot configure while service '%s' is "
                         "running.\n Stop the service manually or use the "
                         "--force flag.\n" % s
@@ -180,7 +176,7 @@
     ret = True
     args = _parse_args(*args)
 
-    m = [c.name for c in args.modules if _isconfigured(c) == NO]
+    m = [c.name for c in args.modules if _isconfigured(c) == configurators.NO]
 
     if m:
         sys.stdout.write(
@@ -201,7 +197,7 @@
 (The force flag will stop the module's service and start it
 afterwards automatically to load the new configuration.)
 """
-        raise InvalidRun(msg)
+        raise configurators.InvalidRun(msg)
 
 
 @expose("validate-config")
@@ -224,7 +220,9 @@
         ret = False
 
     if not ret:
-        raise InvalidConfig("Config is not valid. Check conf files")
+        raise configurators.InvalidConfig(
+            "Config is not valid. Check conf files"
+        )
 
 
 @expose("remove-config")
@@ -251,7 +249,7 @@
             traceback.print_exc(file=sys.stderr)
             failed = True
     if failed:
-        raise InvalidRun("Remove configuration failed")
+        raise configurators.InvalidRun("Remove configuration failed")
 
 
 def _add_dependencies(modulesNames):


-- 
To view, visit http://gerrit.ovirt.org/36813
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icf1fed96d61e0a6ca06af9956b0a071c8ccdc847
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: mooli tayer <mtayer at redhat.com>


More information about the vdsm-patches mailing list