Esempio n. 1
0
def get_config(cfg_path):
    """Load and process the configuration file

    Includes specific settings specific for this module

    Args:
        cfg_path - string containing the path to the configuration file

    Returns:
        Fully populated GripConfig object with most of the configuration data,
        if config loading was successful.  None otherwise.  Also sets up
        some values in the GLOBALS dictionary
    """
    global GLOBALS
    cfg = load_config(cfg_path)
    if cfg is not None:
         GLOBALS['VERBOSE'] = cfg.verbose

    return cfg
Esempio n. 2
0
    Returns:
        No return value
    """
    labels = ["issuetype"
              ,"status"
              ,"resolution"
              ,"priority"
              ]
    api = config.jira_rest_api
    auth = (config.username, config.password)
    for l in labels:
        print("\n\n{0}:".format(l))
        url = "{0}{1}{2}".format(config.server, api, l)
        jsn = get_rest(url, auth)
        dump_data(jsn)
        


if __name__ == '__main__':
    basename = get_basename_arg(__file__, sys.argv)
    if basename is not None:
        cfg_path = basename + ".cfg"
        config = load_config(cfg_path)
        if config is not None:
            descr_main(config)
        else:
            err_str = ("{0}Failed to load configuration file: '{1}' "
                       "Exiting...")
            print(err_str.format(ERR_LABEL, cfg_path))