← Back to team overview

canonical-ubuntu-qa team mailing list archive

Re: [Merge] ~andersson123/autopkgtest-cloud:publish-db-fix into autopkgtest-cloud:master

 


Diff comments:

> diff --git a/charms/focal/autopkgtest-web/webcontrol/publish-db b/charms/focal/autopkgtest-web/webcontrol/publish-db
> index cfda10f..eb03392 100755
> --- a/charms/focal/autopkgtest-web/webcontrol/publish-db
> +++ b/charms/focal/autopkgtest-web/webcontrol/publish-db
> @@ -22,7 +22,8 @@ sqlite3.paramstyle = "named"
>  config = None
>  db_con = None
>  
> -archive_url = "http://archive.ubuntu.com/ubuntu";
> +# archive_url = "http://archive.ubuntu.com/ubuntu";

remove

> +archive_url = "http://ftpmaster.internal/ubuntu";
>  components = ["main", "restricted", "universe", "multiverse"]
>  
>  
> @@ -131,6 +132,9 @@ def get_last_checked(db_con, url):
>  def get_sources(db_con, release):
>      for component in components:
>          for pocket in (release, release + "-updates"):
> +            logging.debug(

remove

> +                "======================================================="
> +            )
>              logging.debug("Processing %s/%s", pocket, component)
>              try:
>                  url = f"{archive_url}/dists/{pocket}/{component}/source/Sources.gz"
> @@ -142,6 +146,11 @@ def get_sources(db_con, release):
>                  # meh, apt_pkg.TagFile() apparently cannot directly read  from an urllib stream
>                  with tempfile.TemporaryFile() as temp_file:
>                      with urllib.request.urlopen(request) as response:
> +                        logging.debug(

remove

> +                            "Url response %s had length %i",
> +                            url,
> +                            len(response.read()),
> +                        )
>                          temp_file.write(response.read())
>                          last_modified = response.getheader("Last-Modified")
>                          if last_modified:
> @@ -179,7 +188,7 @@ def get_sources(db_con, release):
>                                  },
>                              )
>                  db_con.commit()
> -            except urllib.error.HTTPError as e:
> +            except (urllib.error.HTTPError, ConnectionResetError) as e:

ConnectionResetError may not be necessary when using ftpmaster.internal, as it's waaaaay faster, but it can't hurt to have it here just incase

>                  if e.code == 304:
>                      logging.debug("url {} not modified".format(url))
>  


-- 
https://code.launchpad.net/~andersson123/autopkgtest-cloud/+git/autopkgtest-cloud/+merge/467378
Your team Canonical's Ubuntu QA is requested to review the proposed merge of ~andersson123/autopkgtest-cloud:publish-db-fix into autopkgtest-cloud:master.



References