get_config

Will first create it's own configuration based upon the environment, then load
and return it.

def get_config(src_dir):
    """get_config

Will first create it's own configuration based upon the environment, then load
and return it.
    """
    config = None
    configure = "%s/*-dist/scripts/configure.py" % src_dir
    entropy = glob.glob(configure)
    if entropy:
        for item in entropy:
            config = os.path.dirname(item) + "/config.JSON"
            if os.path.isfile(config):
                configure = item
                break
    if os.path.isfile(config) and os.path.isfile(configure):
        subprocess.check_output(str("python %s" % configure).split())
        with open(config, 'r') as fh:
            config = json.loads(fh.read())
    else:
        raise EnvironmentError("Exp setup parameters missing!")
    return config