Wenyi Gao has posted comments on this change.
Change subject: Add some base functions to vdsm-tool
......................................................................
Patch Set 6: (2 inline comments)
This is the base patch for my sequent patches for moving vdsmd.init script to vdsm-tool.
As you know, the vdsmd.init shell script call some shell commands and functions in
/etc/init.d/functions, so I add two warrper function "exec_command" and
"call_init_function" to call them.
The vdsmd.init script is a init script, so the "print_msg" is used to print some
messages followed by "[ OK ] or [Failed]", as do other init scripts.
The vdsmd.init shell script need to read some configuration from configuration file, so
the function "get_config_item" is added to get them.
....................................................
File vdsm-tool/base.py
Line 26: def exec_command(argv):
The base.py is installed in the directory "site-packages/vdsm/tool". While the
implement of "execCmd" is in /usr/share/vdsm/storage/misc", which
can't be accessed by base.py.
Line 52: rc = subprocess.call([cmd], shell=True)
Yes, "shell=True" is dangerous, But I can't find a better way to call two
shell commands in sequence.
--
To view, visit
http://gerrit.ovirt.org/5264
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Id1be737adce28e9ca532aa454e7f0a060947589e
Gerrit-PatchSet: 6
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Wenyi Gao <wenyi(a)linux.vnet.ibm.com>
Gerrit-Reviewer: Adam Litke <agl(a)us.ibm.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Douglas Schilling Landgraf <dougsland(a)redhat.com>
Gerrit-Reviewer: Ewoud Kohl van Wijngaarden <ewoud(a)kohlvanwijngaarden.nl>
Gerrit-Reviewer: Federico Simoncelli <fsimonce(a)redhat.com>
Gerrit-Reviewer: Wenyi Gao <wenyi(a)linux.vnet.ibm.com>