Diff comments:
> diff --git a/charms/focal/autopkgtest-web/webcontrol/db-backup
> b/charms/focal/autopkgtest-web/webcontrol/db-backup
> index b03100b..e060556 100755
> --- a/charms/focal/autopkgtest-web/webcontrol/db-backup
> +++ b/charms/focal/autopkgtest-web/webcontrol/db-backup
> @@ -47,40 +52,10 @@ def db_connect() -> sqlite3.Connection:
>
>
> def backup_db(db_con: sqlite3.Connection):
> - db_backup_con = sqlite3.connect(DB_BACKUP_PATH)
> - with db_backup_con:
> - db_con.backup(db_backup_con, pages=1)
> - db_backup_con.close()
> -
> -
> -def compress_db():
> - """
> - use gzip to compress database
> - """
> - with open(DB_BACKUP_PATH, "rb") as f_in, gzip.open(
> - "%s.gz" % DB_BACKUP_PATH, "wb"
> - ) as f_out:
> - shutil.copyfileobj(f_in, f_out)
> -
> -
> -def init_swift_con() -> swiftclient.Connection:
> - """
> - Establish connection to swift storage
> - """
> - swift_creds = {
> - "authurl": os.environ["OS_AUTH_URL"],
> - "user": os.environ["OS_USERNAME"],
> - "key": os.environ["OS_PASSWORD"],
> - "os_options": {
> - "region_name": os.environ["OS_REGION_NAME"],
> - "project_domain_name": os.environ["OS_PROJECT_DOMAIN_NAME"],
> - "project_name": os.environ["OS_PROJECT_NAME"],
> - "user_domain_name": os.environ["OS_USER_DOMAIN_NAME"],
> - },
> - "auth_version": 3,
> - }
> - swift_conn = swiftclient.Connection(**swift_creds)
> - return swift_conn
> + with open(DB_BACKUP_PATH, "wb") as bkp_file:
> + for line in db_con.iterdump():
> + compressed_line = zstd_compress(data=f"{line}\n".encode())
ahhh, I see, I'll amend this now, thanks!
> + bkp_file.write(compressed_line)
>
>
> def create_container_if_it_doesnt_exist(swift_conn: swiftclient.Connection):
--
https://code.launchpad.net/~andersson123/autopkgtest-cloud/+git/autopkgtest-cloud/+merge/472678
Your team Canonical's Ubuntu QA is requested to review the proposed merge of
~andersson123/autopkgtest-cloud:charm-fixes into autopkgtest-cloud:master.
--
Mailing list: https://launchpad.net/~canonical-ubuntu-qa
Post to : canonical-ubuntu-qa@lists.launchpad.net
Unsubscribe : https://launchpad.net/~canonical-ubuntu-qa
More help : https://help.launchpad.net/ListHelp