On 21 February 2013 18:51, Michael Hanselmann <[email protected]> wrote: > In virtual clusters, all “gnt-*” and “ganeti-*” commands require > environment variables to be set for the virtual cluster root directory > and node name. The “cmd” script generated by “vcluster-setup” is a > wrapper setting those variables. > --- > qa/qa_utils.py | 19 ++++++++++++++++--- > 1 file changed, 16 insertions(+), 3 deletions(-) > > diff --git a/qa/qa_utils.py b/qa/qa_utils.py > index 9533c28..f741d3f 100644 > --- a/qa/qa_utils.py > +++ b/qa/qa_utils.py > @@ -41,6 +41,7 @@ from ganeti import compat > from ganeti import constants > from ganeti import ht > from ganeti import pathutils > +from ganeti import vcluster > > import qa_config > import qa_error > @@ -250,9 +251,21 @@ def GetSSHCommand(node, cmd, strict=True, opts=None, > tty=None): > spath = _MULTIPLEXERS[node][0] > args.append("-oControlPath=%s" % spath) > args.append("-oControlMaster=no") > - args.append(node) > - if cmd: > - args.append(cmd) > + > + (vcluster_master, vcluster_basedir) = \ > + qa_config.GetVclusterSettings() > + > + if vcluster_master: > + args.append(vcluster_master) > + args.append("%s/%s/cmd" % (vcluster_basedir, node)) > + > + if cmd: > + args.append(utils.ShellQuote(cmd))
I'm not sure I understand this. Why are the command arguments quoted, and only for virtual clusters? If there is any non-obvious reason for this, at least there should be a comment explaining it. Otherwise, LGTM. Bernardo
