← Back to team overview

cloud-init-dev team mailing list archive

Re: [Merge] ~smoser/cloud-init:tools/bddeb-per-release-suffix-in-version into cloud-init:master

 


Diff comments:

> diff --git a/packages/bddeb b/packages/bddeb
> index 4f2e2dd..4dc7e38 100755
> --- a/packages/bddeb
> +++ b/packages/bddeb
> @@ -28,6 +29,21 @@ if "avoid-pep8-E402-import-not-top-of-file":
>  DEBUILD_ARGS = ["-S", "-d"]
>  
>  
> +def get_release_suffix(release):
> +    """Given ubuntu release (xenial), return a suffix for package (~16.04.1)"""
> +    csv_path = "/usr/share/distro-info/ubuntu.csv"
> +    rels = {}
> +    # fields are version, codename, series, created, release, eol, eol-server
> +    if os.path.exists(csv_path):
> +        with open(csv_path, "r") as fp:
> +            # version has "16.04 LTS" or "16.10", so drop "LTS" portion.
> +            rels = {row['series']: row['version'].split()[0]

How about we just row['version'].replace(' LTS', '') so we are explicit here?

> +                    for row in csv.DictReader(fp)}
> +    if release in rels:
> +        return "~%s.1" % rels[release]
> +    return ""
> +
> +
>  def run_helper(helper, args=None, strip=True):
>      if args is None:
>          args = []


-- 
https://code.launchpad.net/~smoser/cloud-init/+git/cloud-init/+merge/344544
Your team cloud-init commiters is requested to review the proposed merge of ~smoser/cloud-init:tools/bddeb-per-release-suffix-in-version into cloud-init:master.


References