[c-c upgrade] rename force-componant-version option to force-cube-version and cleanup code stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Mon, 21 Feb 2011 10:31:18 +0100
branchstable
changeset 7028 e8855733b125
parent 7027 d3d7ff6ab54c
child 7029 bae4d11a104b
[c-c upgrade] rename force-componant-version option to force-cube-version and cleanup code
cwctl.py
--- a/cwctl.py	Mon Feb 21 10:28:59 2011 +0100
+++ b/cwctl.py	Mon Feb 21 10:31:18 2011 +0100
@@ -664,10 +664,11 @@
     name = 'upgrade'
     actionverb = 'upgraded'
     options = InstanceCommand.options + (
-        ('force-componant-version',
-         {'short': 't', 'type' : 'csv', 'metavar': 'cube1=X.Y.Z,cube2=X.Y.Z',
+        ('force-cube-version',
+         {'short': 't', 'type' : 'named', 'metavar': 'cube1:X.Y.Z,cube2:X.Y.Z',
           'default': None,
-          'help': 'force migration from the indicated  version for the specified cube.'}),
+          'help': 'force migration from the indicated version for the specified cube(s).'}),
+
         ('force-cubicweb-version',
          {'short': 'e', 'type' : 'string', 'metavar': 'X.Y.Z',
           'default': None,
@@ -721,12 +722,9 @@
         mih = config.migration_handler()
         repo = mih.repo_connect()
         vcconf = repo.get_versions()
-        if self.config.force_componant_version:
-            packversions = {}
-            for vdef in self.config.force_componant_version:
-                componant, version = vdef.split('=')
-                packversions[componant] = Version(version)
-            vcconf.update(packversions)
+        if self.config.force_cube_version:
+            for cube, version in self.config.force_cube_version.iteritems():
+                vcconf[cube] = Version(version)
         toupgrade = []
         for cube in config.cubes():
             installedversion = config.cube_version(cube)