From 5cefeb25fc89cb25eb40853ba898fc46978bf0b8 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 16 Sep 2011 18:26:18 +0200 Subject: [PATCH] +/- todo, improve argument handling Signed-off-by: Nico Schottelius --- bin/cdist | 14 ++++++++++++-- doc/dev/todo/niconext | 26 +++++++++++--------------- 2 files changed, 23 insertions(+), 17 deletions(-) diff --git a/bin/cdist b/bin/cdist index 032b078d..8d5e9342 100755 --- a/bin/cdist +++ b/bin/cdist @@ -434,6 +434,7 @@ class Cdist: env = os.environ.copy() env['PATH'] = self.bin_dir + ":" + env['PATH'] + # Information required in every manifest env['__target_host'] = self.target_host env['__global'] = self.out_dir @@ -630,10 +631,19 @@ def emulator(): # And finally verify parameter args = parser.parse_args(sys.argv[1:]) - # Record parameter - # wh + object_id = args.object_id + + del args.object_id print(args) + # Record parameter + params = vars(args) + for param in params: + value = getattr(args, param) + if value: + print("Writing " + param + " = " + value) + + # Record requirements if "__require" in os.environ: requirements = os.environ['__require'] diff --git a/doc/dev/todo/niconext b/doc/dev/todo/niconext index c9fd6c0d..bd30c08d 100644 --- a/doc/dev/todo/niconext +++ b/doc/dev/todo/niconext @@ -1,3 +1,14 @@ +- Rewrite cdist-type-emulator + - Remove legacy code in cdist + - Remove cdist-config + - Remove man1/cdist-type-emulator.text + - Remove the PATH=... part from the README + + - how to access output dir? + + Test: + __cdist_type_base_dir=$(pwd -P)/conf/type __file + - Initial install support - setup $__install = "yes" for manifest(s), gencode-* @@ -18,21 +29,6 @@ - and maximum number of parallel runs (-p X) - error handling / report failed hosts -- Rewrite cdist-type-emulator - - Remove legacy code in cdist - - Remove cdist-config - - Remove man1/cdist-type-emulator.text - - Remove the PATH=... part from the README - - - basename(argv0) == type - - how to get to type dir? - - dependent on -c to cdist! - - submit via internal env! - - need to build parameter parser - - Test: - __cdist_type_base_dir=$(pwd -P)/conf/type __file - - Allow manifest to be read from stdin - Create new video for cdist 2.0.0 http://www.youtube.com/watch?v=PRMjzy48eTI