def get_cfg( verbose=False ): global cfg if not cfg: cfg = load_combined( SITE_FILE, "site config", USER_FILE, "user config", SPEC, None, True, verbose ) return cfg
def get_cfg( verbose=False ): global cfg if not cfg: cfg = load_combined( SITE_FILE, "site config", USER_FILE, "user config", SPEC, upg, True, verbose ) # host item values of None default to modified localhost values for host in cfg['hosts']: if host == 'localhost': continue for item, value in cfg['hosts'][host].items(): newvalue = value or cfg['hosts']['localhost'][item] if newvalue and 'directory' in item: # replace local home dir with $HOME for evaluation on other host newvalue = newvalue.replace( os.environ['HOME'], '$HOME' ) cfg['hosts'][host][item] = newvalue return cfg
def get_cfg(verbose=False): global cfg if not cfg: cfg = load_combined(SITE_FILE, "site config", USER_FILE, "user config", SPEC, None, True, verbose) return cfg