construct_cfgs

Performs actions to construct either the setup.cfg (rpm) or stdeb.cfg (deb)
files as per the operating system specified.  This construction is done as
per the setup_requirements.txt file from within the working directory
specified.

This is a very tempermental function by design.  It intentionally exits
with a non-zero if/when an error has occurred on its own.  Therefore, it is
not suggested to use this function if you intend to get control back again.

def construct_cfgs(**kargs):
    """construct_cfgs

Performs actions to construct either the setup.cfg (rpm) or stdeb.cfg (deb)
files as per the operating system specified.  This construction is done as
per the setup_requirements.txt file from within the working directory
specified.

This is a very tempermental function by design.  It intentionally exits
with a non-zero if/when an error has occurred on its own.  Therefore, it is
not suggested to use this function if you intend to get control back again.
    """
    docker_dir = _check_args(**kargs)
    if not docker_dir or not os.path.isdir(docker_dir):
        print("Unable to determine the %s/%s combo under supported versioning"
              % (kargs['operating_system'], kargs['version']))
        exit_cleanly(error_number=errno.ENOSYS)
    if kargs['operating_system'] == 'redhat':
        _build_setup_cfg(kargs['working_directory'])
    elif kargs['operating_system'] == 'ubuntu':
        _build_stdeb_cfg(kargs['working_directory'])
    else:
        print("Unsure of what to do... operating_system(%s) is not recognized!"
              % kargs['operating_system'])