From 2f70a0d70e5c4aae07bf93d61752e34df4f2c2eb Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Tue, 17 Sep 2013 23:33:30 +0200 Subject: [PATCH] need a way to set remote.base_path from the command line Signed-off-by: Steven Armstrong --- cdist/config.py | 3 ++- cdist/exec/remote.py | 7 ++----- scripts/cdist | 2 ++ 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cdist/config.py b/cdist/config.py index 988695ed..dcaac740 100644 --- a/cdist/config.py +++ b/cdist/config.py @@ -124,7 +124,8 @@ class Config(object): remote = cdist.exec.remote.Remote( target_host=host, 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.run() diff --git a/cdist/exec/remote.py b/cdist/exec/remote.py index 7c807092..3ffda12f 100644 --- a/cdist/exec/remote.py +++ b/cdist/exec/remote.py @@ -48,15 +48,12 @@ class Remote(object): target_host, remote_exec, remote_copy, - base_path=None): + base_path="/var/lib/cdist"): self.target_host = target_host self._exec = remote_exec self._copy = remote_copy - if base_path: - self.base_path = base_path - else: - self.base_path = "/var/lib/cdist" + self.base_path = base_path self.conf_path = os.path.join(self.base_path, "conf") self.object_path = os.path.join(self.base_path, "object") diff --git a/scripts/cdist b/scripts/cdist index 24a955ae..7bd58e58 100755 --- a/scripts/cdist +++ b/scripts/cdist @@ -68,6 +68,8 @@ def commandline(): help='Do not execute code', action='store_true') parser['config'].add_argument('-o', '--out-dir', 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', help='Operate on multiple hosts in parallel', action='store_true', dest='parallel')