canonical / canonical/cloud-init
using two keys for one apt source fails
- Dominant language
- Python
- Stars
- 3.8k
- Forks
- 1.1k
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 18
Description
This bug was originally filed in Launchpad as [LP: #1005975](https://bugs.launchpad.net/cloud-init/+bug/1005975)
Launchpad details
affected_projects = []
assignee = vnovikov
assignee_name = Vladimir Novikov
date_closed = None
date_created = 2012-05-29T15:43:08.771710+00:00
date_fix_committed = None
date_fix_released = None
id = 1005975
importance = low
is_complete = False
lp_url = https://bugs.launchpad.net/cloud-init/+bug/1005975
milestone = None
owner = tomvn
owner_name = Tom vN
private = False
status = confirmed
submitter = tomvn
submitter_name = Tom vN
tags = []
duplicates = []
_Launchpad user **Tom vN(tomvn)** wrote on 2012-05-29T15:43:08.771710+00:00_
My use case is the Apache built Cassandra repos which require two keys to be added to apt-key.
the utils.getkeybyid function doesn't use quotes around the key for this command:
$ gpg --keyserver ${ks} --recv $k >/dev/null &&
which works just fine for adding two keys from the same key server, using Cassandra as the example:
$ gpg --keyserver pgp.mit.edu --recv F758CE318D77295D 2B5C1B00
The function then switches to using quotes for the rest of the commands:
$ armour=$(gpg --export --armour "${k}") &&
$ gpg --batch --yes --delete-keys "${k}"
As these commands are in the utils.getkeybyid function they only delete and then return the public key block for the first key. The second one gets ignored by the delete and the export, so I end up with it not in my apt-key and still in gpg.
Remove the quotes around the ${k} and these commands complete correctly and return the correct public key block, which then results in both keys getting added to the apt-key.
So, unless there's a good reason to quote the ${k} it seems to be more flexible without them.
Contributor guide
Assessment
This issue has not been assessed yet.