[Merge] ~mitchburton/ubuntu/+source/landscape-client:ubuntu/lunar-devel into ubuntu/+source/landscape-client:ubuntu/lunar-devel

Andreas Hasenack mp+437634 at code.launchpad.net
Thu Feb 23 20:46:50 UTC 2023



Diff comments:

> diff --git a/landscape/client/manager/aptsources.py b/landscape/client/manager/aptsources.py
> index 649569b..866c6ba 100644
> --- a/landscape/client/manager/aptsources.py
> +++ b/landscape/client/manager/aptsources.py
> @@ -83,16 +85,12 @@ class AptSources(ManagerPlugin):
>                        "-----END PGP PUBLIC KEY BLOCK-----"]}
>          """
>          deferred = succeed(None)
> +        prefix = 'landscape-server-'
>          for key in message["gpg-keys"]:
> -            fd, path = tempfile.mkstemp()
> -            os.close(fd)
> -            with open(path, "w") as key_file:
> +            filename = prefix + str(uuid.uuid4()) + '.asc'

Also note that an `.asc` gpg key is only supported by apt >= 1.4, as per https://manpages.ubuntu.com/manpages/jammy/man8/apt-key.8.html#deprecation. Checking rmadison, only trusty and xenial have a lower version of apt, so if you ever intend to SRU this to those ubuntu releases, it won't work. Bionic already has apt 1.6.x.

> +            key_path = os.path.join(self.TRUSTED_GPG_D, filename)
> +            with open(key_path, "w") as key_file:
>                  key_file.write(key)
> -            deferred.addCallback(
> -                lambda ignore, path=path:
> -                    self._run_process("/usr/bin/apt-key", ["add", path]))
> -            deferred.addCallback(self._handle_process_error)
> -            deferred.addBoth(self._remove_and_continue, path)
>          deferred.addErrback(self._handle_process_failure)
>          deferred.addCallback(self._handle_sources, message["sources"])
>          return self.call_with_operation_result(message, lambda: deferred)


-- 
https://code.launchpad.net/~mitchburton/ubuntu/+source/landscape-client/+git/landscape-client/+merge/437634
Your team Ubuntu Sponsors Team is requested to review the proposed merge of ~mitchburton/ubuntu/+source/landscape-client:ubuntu/lunar-devel into ubuntu/+source/landscape-client:ubuntu/lunar-devel.




More information about the Ubuntu-sponsors mailing list