Merge remote-tracking branch 'steven/initial-manifest-from-stdin'

This commit is contained in:
Nico Schottelius 2011-11-02 16:37:19 +01:00
commit f517f2667d
2 changed files with 19 additions and 1 deletions

View file

@ -60,7 +60,7 @@ def commandline():
help='Change cdist home (default: .. from bin directory)', help='Change cdist home (default: .. from bin directory)',
action='store') action='store')
parser['configinstall'].add_argument('-i', '--initial-manifest', 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) dest='manifest', required=False)
parser['configinstall'].add_argument('-p', '--parallel', parser['configinstall'].add_argument('-p', '--parallel',
help='Operate on multiple hosts in parallel', help='Operate on multiple hosts in parallel',
@ -104,6 +104,17 @@ def configinstall(args, mode):
import multiprocessing import multiprocessing
import time 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: try:
process = {} process = {}
failed_hosts = [] failed_hosts = []

7
doc/dev/fancy-ideas Normal file
View file

@ -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