-# quick & dirty - should probably use the parseroption object instead
-# and move to TestMain as well
-exclude_options_keys = [ 'ensure_value' , 'read_file', 'read_module' ]
-def show_options (message,options):
- now=time.strftime("%H:%M:%S", time.localtime())
- print ">",now,"--",message
- for k in dir(options):
- if k.find("_")==0: continue
- if k in exclude_options_keys: continue
- print " ",k,":",getattr(options,k)
-
-def show_site_spec (site):
- print '* ======== site',site['site_fields']['name']
- for (k,v) in site.iteritems():
- if k=='nodes':
- if v:
- print '* \t\t','nodes : ',
- for node in v:
- print node['node_fields']['hostname'],'',
- print ''
- elif k=='users':
- if v:
- print '* \t\tusers : ',
- for user in v:
- print user['name'],'',
- print ''
- elif k == 'site_fields':
- print '* \t\tlogin_base',':',v['login_base']
- elif k == 'address_fields':
- pass
- else:
- print '* \t\t',k,
- PrettyPrinter(indent=8,depth=2).pprint(v)
-
-def show_initscript_spec (initscript):
- print '* ======== initscript',initscript['initscript_fields']['name']
-
-def show_key_spec (key):
- print '* ======== key',key['name']