[Merge] lp:~sil2100/ubuntu-archive-tools/retry-and-manual into lp:ubuntu-archive-tools

Brian Murray brian at ubuntu.com
Tue Jun 12 23:02:04 UTC 2018


Review: Needs Fixing

I think this needs some reworking see my inline comment.

Diff comments:

> === modified file 'sru-review'
> --- sru-review	2018-05-24 17:34:44 +0000
> +++ sru-review	2018-06-04 18:23:09 +0000
> @@ -371,9 +372,26 @@
>          print("Accepted")
>          if changes['bugs']:
>              for bug_num in changes['bugs']:
> -                process_bug(
> -                    launchpad, upload.package_name, upload.package_version,
> -                    upload.distroseries.name, bug_num)
> +                success = False
> +                for i in range(3):
> +                    try:
> +                        process_bug(
> +                            launchpad, upload.package_name, upload.package_version,
> +                            upload.distroseries.name, bug_num)
> +                    except ServerError:
> +                        # In some cases LP can time-out, so retry a few times.
> +                        continue
> +                    else:
> +                        success = True
> +                        break
> +                if not success:
> +                    print('\nFailed communicating with Launchpad to process '
> +                          'the SRU bugs.  Please retry manually by running:\n'
> +                          'sru-accept -p %s -s %s -v %s %s' %
> +                          (upload.package_name, upload.distroseries.name,
> +                           upload.package_version, bug_num))

What if it fails three times on the second out of five bugs? This only give you the command to run for the second bug not the third, fourth, or fifth.

> +                    sys.exit(1)
> +
>      else:
>          print("REJECT the package from -proposed? [yN] ", end="")
>          sys.stdout.flush()


-- 
https://code.launchpad.net/~sil2100/ubuntu-archive-tools/retry-and-manual/+merge/347395
Your team Ubuntu Package Archive Administrators is requested to review the proposed merge of lp:~sil2100/ubuntu-archive-tools/retry-and-manual into lp:ubuntu-archive-tools.



More information about the ubuntu-archive mailing list