chef
chef copied to clipboard
Bug fix for apt_repository when creating a new keyring (#15008)
- when they keyring does not exists or it empty the key is not valid
The keyring_key_is_valid function will run the following:
$ gpg --no-default-keyring --keyring /etc/apt/keyrings/ring.gpg --list-public-keys fingerprint
gpg: error reading key: No public key
$ echo $?
2
the stdout none? matcher will return true for this error and the key will be delcared "valid" even though it does not exist. This will cause the not_if block called from install_key_from_keyserver_to_keyring to skip the execute and the key will not be installed.
Description
Related Issue
Types of changes
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [ ] Chore (non-breaking change that does not add functionality or fix an issue)
Checklist:
- [ ] I have read the CONTRIBUTING document.
- [ ] I have run the pre-merge tests locally and they pass.
- [ ] I have updated the documentation accordingly.
- [ ] I have added tests to cover my changes.
- [ ] If
Gemfile.lockhas changed, I have used--conservativeto do it and included the full output in the Description above. - [ ] All new and existing tests passed.
- [ ] All commits have been signed-off for the Developer Certificate of Origin.
Quality Gate passed
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code