(cmd_opts, cmd_args) = create_cmd_parser(command).parse_args(args[1:])
verbose = options.verbose
if verbose :
- print options.registry, options.sm, options.dir, options.verbose,\
- options.user, options.auth
- print command
+ print "Resgistry %s, sm %s, dir %s, user %s, auth %s" % (options.registry,
+ options.sm,
+ options.dir,
+ options.user,
+ options.auth)
+ print "Command %s" %command
if command in ("resources"):
- print cmd_opts.format
+ print "resources cmd_opts %s" %cmd_opts.format
elif command in ("list","show","remove"):
- print cmd_opts.type
- print cmd_args
+ print "cmd_opts.type %s" %cmd_opts.type
+ print "cmd_args %s" %cmd_args
set_servers(options)
global registry
user_cred = get_user_cred()
list = registry.list(user_cred, args[0])
+ # filter on person, slice, site, node, etc.
+ # THis really should be in the filter_records funct def comment...
list = filter_records(opts.type, list)
display_records(list)
if opts.file:
return
def display_records(recordList, dump = False):
+ ''' Print all fields in the record'''
for record in recordList:
display_record(record, dump)
def display_record(record, dump = False):
if dump:
- record.dump(False)
+ record.dump()
else:
info = record.getdict()
print "%s (%s)" % (info['hrn'], info['type'])