mirror of
https://github.com/munki/munki.git
synced 2026-01-10 08:40:22 -06:00
Added display_included_manifest()
This commit is contained in:
@@ -576,6 +576,37 @@ def display_manifest(args):
|
||||
return 2 # No such file or directory
|
||||
|
||||
|
||||
def display_included_manifests(args):
|
||||
parser = MyOptionParser()
|
||||
parser.set_usage('''display-included-manifest MANIFESTNAME
|
||||
Prints included manifests in the specified manifest''')
|
||||
try:
|
||||
_, arguments = parser.parse_args(args)
|
||||
except MyOptParseError, errmsg:
|
||||
print >> sys.stderr, str(errmsg)
|
||||
return 22 # Invalid argument
|
||||
if len(arguments) != 1:
|
||||
parser.print_usage(sys.stderr)
|
||||
return 7 # Argument list too long
|
||||
manifestname = arguments[0]
|
||||
manifest = get_manifest(manifestname)
|
||||
if manifest:
|
||||
print 'Manifest: %s' % manifestname
|
||||
manifest_recurser(manifest)
|
||||
else:
|
||||
return 2 # No such file or directory
|
||||
|
||||
|
||||
def manifest_recurser(manifest):
|
||||
# No infinite loop checking! Be wary!
|
||||
printplist(manifest)
|
||||
if 'included_manifests' in manifest:
|
||||
for item in manifest['included_manifests']:
|
||||
manifest = get_manifest(item)
|
||||
print '\nManifest %s' % item
|
||||
manifest_recurser(manifest)
|
||||
|
||||
|
||||
def new_manifest(args):
|
||||
'''Creates a new, empty manifest'''
|
||||
parser = MyOptionParser()
|
||||
|
||||
Reference in New Issue
Block a user