Yaniv Bronhaim has posted comments on this change.
Change subject: vdsm-tool: Change upgrade mechanism ......................................................................
Patch Set 3:
(4 comments)
http://gerrit.ovirt.org/#/c/27193/3//COMMIT_MSG Commit Message:
Line 10: to only run once. It has flags to override, but being a function Line 11: decorator, it did not have any direct access to command line arguments Line 12: and did access via sys.argv[2:]. Line 13: Line 14: There is a patch that will be sent that will add flags to vdsm-tool and now you can replace it with http://gerrit.ovirt.org/#/c/27481/ Line 15: will break upgrade and its argument parsing. I'm proposing to change the Line 16: upgrade from being a decorated function, to a function that operates on Line 17: an upgrade object (interface documented in apply_upgrade docstring) and Line 18: the command line arguments.
Line 18: the command line arguments. Line 19: Line 20: This also allows to have a single argument parser for both Line 21: general upgrade flags and specific per-upgrade flags (no current Line 22: upgrades define flags but we might want this in future). worth to mention the extendArgument func that needs to be declared Line 23: Line 24: Change-Id: I6e1d28570dedfeff9fe60624b1db72d8cadf136a
http://gerrit.ovirt.org/#/c/27193/3/tests/toolTests.py File tests/toolTests.py:
Line 179: Line 180: Line 181: class UpgradeTests(TestCase): Line 182: Line 183: class UpgraduratorTM(object): maybe upgrade.py name was the only problem... upgradurator sounds much tougher Line 184: name = 'test' Line 185: Line 186: def __init__(self, lst): Line 187: self.lst = lst
Line 195: def run(self, ns, args): Line 196: self.lst[0] += 1 Line 197: self.ns = ns Line 198: self.args = args Line 199: return 0 do you test where the output goes? ^ Line 200: Line 201: class BadUpgraduratorTM(object): Line 202: name = 'bad' Line 203: