need a way to set remote.base_path from the command line

Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
This commit is contained in:
Steven Armstrong 2013-09-17 23:33:30 +02:00
parent bfae291cf7
commit 2f70a0d70e
3 changed files with 6 additions and 6 deletions

View file

@ -124,7 +124,8 @@ class Config(object):
remote = cdist.exec.remote.Remote( remote = cdist.exec.remote.Remote(
target_host=host, target_host=host,
remote_exec=args.remote_exec, remote_exec=args.remote_exec,
remote_copy=args.remote_copy) remote_copy=args.remote_copy,
base_path=args.remote_out_path)
c = cls(local, remote, dry_run=args.dry_run) c = cls(local, remote, dry_run=args.dry_run)
c.run() c.run()

View file

@ -48,15 +48,12 @@ class Remote(object):
target_host, target_host,
remote_exec, remote_exec,
remote_copy, remote_copy,
base_path=None): base_path="/var/lib/cdist"):
self.target_host = target_host self.target_host = target_host
self._exec = remote_exec self._exec = remote_exec
self._copy = remote_copy self._copy = remote_copy
if base_path: self.base_path = base_path
self.base_path = base_path
else:
self.base_path = "/var/lib/cdist"
self.conf_path = os.path.join(self.base_path, "conf") self.conf_path = os.path.join(self.base_path, "conf")
self.object_path = os.path.join(self.base_path, "object") self.object_path = os.path.join(self.base_path, "object")

View file

@ -68,6 +68,8 @@ def commandline():
help='Do not execute code', action='store_true') help='Do not execute code', action='store_true')
parser['config'].add_argument('-o', '--out-dir', parser['config'].add_argument('-o', '--out-dir',
help='Directory to save cdist output in', dest="out_path") help='Directory to save cdist output in', dest="out_path")
parser['config'].add_argument('-r', '--remote-out-dir',
help='Directory to save cdist output in on the target host', dest="remote_out_path")
parser['config'].add_argument('-p', '--parallel', parser['config'].add_argument('-p', '--parallel',
help='Operate on multiple hosts in parallel', help='Operate on multiple hosts in parallel',
action='store_true', dest='parallel') action='store_true', dest='parallel')