build_debian

Builds for a specific debian operating system with os version
specified.  By default, it will use os_type='ubuntu'

def build_debian(config, os_versions, os_type='ubuntu'):
    """build_debian

Builds for a specific debian operating system with os version
specified.  By default, it will use os_type='ubuntu'
    """
    def build_pkg(config, os_type, os_version):
        result = _build_package(config, os_type, os_version)
        if not result.succeeded:
            print(result.cli)
            raise DebianError(result, os_type, os_version, frame=gfi(cf()))

    error = 0
    if isinstance(os_versions, str):
        os_version = os_versions
        try:
            build_pkg(config, os_type, os_version)
        except DebianError as error:
            error.print_msg()
    else:
        for os_version in os_versions:
            try:
                build_pkg(config, os_type, os_version)
            except DebianError as error:
                error.print_msg()
    return error