From 7641c04438e01408ac685879f1363f1cea562c69 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Mon, 31 Oct 2011 13:40:39 +0100 Subject: [PATCH 1/2] +fancy-ideas Signed-off-by: Steven Armstrong --- doc/dev/fancy-ideas | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 doc/dev/fancy-ideas diff --git a/doc/dev/fancy-ideas b/doc/dev/fancy-ideas new file mode 100644 index 00000000..f125a884 --- /dev/null +++ b/doc/dev/fancy-ideas @@ -0,0 +1,7 @@ +== types with namespaces == +- allow types to have namespaces, e.g. + __path/my/type +implemented as a proof of concept at: +https://github.com/asteven/cdist/tree/type-namespaces + + From b38262f858077f8f57781d60e4439ad07b0be0ab Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Mon, 31 Oct 2011 16:07:33 +0100 Subject: [PATCH 2/2] implement reading initial manifest from stdin Signed-off-by: Steven Armstrong --- bin/cdist | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/bin/cdist b/bin/cdist index ffda3e42..4d9cd8a2 100755 --- a/bin/cdist +++ b/bin/cdist @@ -60,7 +60,7 @@ def commandline(): help='Change cdist home (default: .. from bin directory)', action='store') parser['configinstall'].add_argument('-i', '--initial-manifest', - help='Path to a cdist manifest', + help='Path to a cdist manifest or \'-\' to read from stdin.', dest='manifest', required=False) parser['configinstall'].add_argument('-p', '--parallel', help='Operate on multiple hosts in parallel', @@ -104,6 +104,17 @@ def configinstall(args, mode): import multiprocessing import time + initial_manifest_tempfile = None + if args.manifest == '-': + # read initial manifest from stdin + import tempfile + handle, initial_manifest_temp_path = tempfile.mkstemp(prefix='cdist.stdin.') + with os.fdopen(handle, 'w') as fd: + fd.write(sys.stdin.read()) + args.manifest = initial_manifest_temp_path + import atexit + atexit.register(lambda: os.remove(initial_manifest_temp_path)) + try: process = {} failed_hosts = []