Saggi Mizrahi has posted comments on this change.
Change subject: vdsm-tool: vdsm-id: add force option to force generate id ......................................................................
Patch Set 11:
(2 comments)
http://gerrit.ovirt.org/#/c/20808/11/lib/vdsm/tool/vdsm-id.py File lib/vdsm/tool/vdsm-id.py:
Line 17: # Refer to the README and COPYING files for full details of the license Line 18: # Line 19: Line 20: Line 21: import argparse argparse is a 2.7 feature. Iirc it's not available in el6.
Should this code be supported on el6? Line 22: import sys Line 23: Line 24: Line 25: from ..utils import getHostUUID
http://gerrit.ovirt.org/#/c/20808/11/lib/vdsm/utils.py File lib/vdsm/utils.py:
Line 825: Line 826: if ret == 0 and 'Not' not in out: Line 827: # Avoid error string - 'Not Settable' or 'Not Present' Line 828: __hostUUID = out.strip() Line 829: elif force: I think that a getter shouldn't really create the things it's supposed to retrieve.
The whole concept of force getter is a bit odd. You are trying so hard to get the UUID that you end up making one up? Line 830: hostid = str(uuid.uuid4()) Line 831: with open(constants.P_VDSM_NODE_ID, 'w') as f: Line 832: f.write("%s\n", hostid) Line 833: ovirtNodePersist([constants.P_VDSM_NODE_ID])