Applying Bionic repository profile doesn't work
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Landscape Client |
Fix Released
|
High
|
Simon Poirier | ||
landscape-client (Ubuntu) |
Fix Released
|
High
|
Simon Poirier | ||
Bionic |
Fix Released
|
Medium
|
Simon Poirier |
Bug Description
[Impact]
* Users trying to apply changes to package profiles through landscape will get
an error in the activity. This will result in incomplete apt source list on
those clients.
* This change add handling for both unicode and bytes contents for
apt-
[Test Case]
* install landscape-
* create user, generate api key and export it in a shell
* Import the mirror key
$ curl 'https:/
$ landscape-api import-gpg-key ubuntu-
* Create a gpg key named sign-key, without passphrase:
$ gpg --gen-key
$ gpg -a -o sign-key --export-secret-key sign-key
$ landscape-api import-gpg-key sign-key ./sign-key
* Create a mirror and profile
$ landscape-api create-distribution ubuntu
$ landscape-api create-series --pockets security --components restricted --architectures amd64 --mirror-gpg-key ubuntu-
$ landscape-api sync-mirror-pocket security bionic-repo ubuntu
$ landscape-api create-
$ landscape-api associate-
* Create a bionic container or machine, and install landscape-client.
$ echo | openssl s_client --connect landscape-
$ landscape-config --silent --computer-title "My Web Server" --account-name standalone --url https:/
* Accept the client and repository activitiy. The profile should apply correctly.
$ landscape-api accept-
$ landscape-api approve-activities type:ChangeRepo
* Update the repository profile. The activity should succeed with the fix,
and the client should have a non-empty source file at
/etc/
$ landscape-api add-pockets-
[LandscapeUpdates]
https:/
[Regression Potential]
* This change tries to correct the issue as simply and locally as possible.
* Further regressions are unlikely as the fix only adds a flag in case the
content is not the expected type when writing.
* No other functionality depends on this code path.
[Other Info]
* Shouldn't the content always be str anyway? Yes, but messages which went
through the broker before the python3 switch wouldn't be due previously
implicit typing, thus the fact we need to handle both.
* Shouldn't there be other messages with the same issue? There were, and
they got caught before the 18.01 release.
[Original description]
Landscape can't apply Ubuntu 18.04 repository profiles.
Steps to reproduce:
1) Have the newest Ubuntu signing mirror key [C0B21F32] and your resign mirror key imported, and a registered 18.04 computer that has the tag "bionic-test".
2) Create a small repository:
$ landscape-api create-distribution ubuntu
$ landscape-api create-series --pockets security --components restricted --architectures amd64 --mirror-gpg-key ubuntu-
3) Initiate the sync:
$ landscape-api sync-mirror-pocket security bionic-repo ubuntu
4) Create a repository profile:
$ landscape-api create-
5) Associate the repository profile to the computer with the "bionic-test" tag:
$ landscape-api associate-
6) Add the security pocket to the repository profile:
$ landscape-api add-pockets-
The activity fails with "TypeError: a bytes-like object is required, not 'str'", and the landscape-
Changed in landscape: | |
importance: | Undecided → High |
Changed in landscape: | |
assignee: | nobody → Simon Poirier (simpoir) |
status: | New → Triaged |
status: | Triaged → In Progress |
Changed in landscape: | |
status: | In Progress → Fix Committed |
information type: | Proprietary → Public |
affects: | landscape → landscape-client (Ubuntu) |
Changed in landscape-client (Ubuntu): | |
status: | Fix Committed → In Progress |
status: | In Progress → Confirmed |
Changed in landscape-client: | |
status: | New → Fix Committed |
assignee: | nobody → Simon Poirier (simpoir) |
importance: | Undecided → High |
Changed in landscape-client (Ubuntu Bionic): | |
assignee: | nobody → Simon Poirier (simpoir) |
importance: | Undecided → Medium |
status: | New → In Progress |
Changed in landscape-client (Ubuntu): | |
status: | Confirmed → In Progress |
tags: |
added: verification-done verification-done-bionic removed: verification-needed verification-needed-bionic |
Changed in landscape-client: | |
status: | Fix Committed → Fix Released |
https:/ /github. com/CanonicalLt d/landscape- client/ pull/48