Change in vdsm[master]: vdsmd and supervdsmd: extract common init tasks and add init...

zhshzhou at linux.vnet.ibm.com zhshzhou at linux.vnet.ibm.com
Fri Jul 19 03:59:55 UTC 2013


Zhou Zheng Sheng has posted comments on this change.

Change subject: vdsmd and supervdsmd: extract common init tasks and add init adapter
......................................................................


Patch Set 8: (4 inline comments)

....................................................
File vdsm/daemonAdapter
Line 47:     parser.add_argument(
Line 48:         '--target-option', dest='targetOption', default=list(),
Line 49:         metavar='target_opt0,target_opt1,...', action='append',
Line 50:         help='Add comma seperated options to be passed to target, multiple '
Line 51:         'occurrences of "--target-option opt" accumulates the options')
I had the same thought. I think this can shorten the argument lists a lot and make daemonAdapter a more general utility.
Line 52:     args = parser.parse_args(sys.argv[1:])
Line 53:     return args
Line 54: 
Line 55: 


....................................................
File vdsm/supervdsmd.service.in
Line 2: Description="Auxiliary vdsm service for running helper functions as root"
Line 3: 
Line 4: [Service]
Line 5: Type=simple
Line 6: ExecStart=@PYTHON@ "@VDSMDIR@/daemonAdapter" -t "@PYTHON@" "--target-option=@VDSMDIR@/supervdsmServer.pyc,--sockfile=@VDSMRUNDIR@/svdsm.sock"
I'd like to take your advice of passing arguments transparently, so this made the python magic less ugly.


Line 3
Line 4
Line 5
Line 6
Line 7
Better do it in a next new patch, and it seems supervdsmd does not make use of environment variables. If we need the variables we can add the env file.


....................................................
File vdsm/supervdsmServer.py
Line 409: 
Line 410: 
Line 411: def _parse_args():
Line 412:     argDict = {}
Line 413:     opts, args = getopt.getopt(sys.argv[1:], "h", ["sockfile=", "pidfile="])
Because vdsmd use optparse, so just follow the same pattern. I think argparse is for more advanced cases.
Line 414:     for o, v in opts:
Line 415:         o = o.lower()
Line 416:         if o == "--sockfile":
Line 417:             argDict['sockfile'] = v


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Id8e514df1ca88500f746242134ddb24c31588046
Gerrit-PatchSet: 8
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Zhou Zheng Sheng <zhshzhou at linux.vnet.ibm.com>
Gerrit-Reviewer: Alon Bar-Lev <alonbl at redhat.com>
Gerrit-Reviewer: Mark Wu <wudxw at linux.vnet.ibm.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei at redhat.com>
Gerrit-Reviewer: Zhou Zheng Sheng <zhshzhou at linux.vnet.ibm.com>
Gerrit-Reviewer: oVirt Jenkins CI Server


More information about the vdsm-patches mailing list