Handle missing native dependencies in securesystemslib.gpg#206
Handle missing native dependencies in securesystemslib.gpg#206lukpueh merged 5 commits intosecure-systems-lab:masterfrom
Conversation
securesystemslib.gpg.constants checks for the presence of a gpg binary at import time, save the result of this search in a constant HAVE_GPG so that we can use it later to present meaningful error messages when a function requiring gpg is called and the command isn't available. Signed-off-by: Joshua Lock <[email protected]>
|
Need to fix the |
856df02 to
283cea3
Compare
lukpueh
left a comment
There was a problem hiding this comment.
Great work as always! Many thanks, @joshuagl! I have left 3 minuscule comments. Also, IIUC, we should be able to remove this block in aggregate_tests.py now (the call in L57 too), and in test_gpg.py replace
occurrences of
@unittest.skipIf(os.getenv("TEST_SKIP_GPG"), "gpg not found")
with
@unittest.skipIf(not securesystemslib.gpg.constants.HAVE_GPG, "gpg not found")
Right?
|
Thanks for the review @lukpueh !
Absolutely right. That will be a nice clean up. I'll update the PR with that and your other requested changes on Monday. |
Raise an UnsupportedLibraryError exception when functions that rely on invoking the gpg command are called on a system where gpg is unavailable. Signed-off-by: Joshua Lock <[email protected]>
Raise UnsupportedLibraryError from each function in the gpg modules when the native libraries needed by that function aren't available. Signed-off-by: Joshua Lock <[email protected]>
283cea3 to
6125013
Compare
Signed-off-by: Joshua Lock <[email protected]>
We don't need to detect the presence of the GPG command and set environment variables, instead we can use the HAVE_GPG constant which indicated whether a usable GPG command is present on the system. Signed-off-by: Joshua Lock <[email protected]>
6125013 to
d6c3933
Compare
|
I've update the PR to incorporate your suggested changes @lukpueh . Please take a look when you have the time. |
Fixes issue #:
#179
Description of the changes being introduced by the pull request:
gpg[2]command in all functions that would call it and raiseUnsupportedLibraryErrorsecuresystemslib.gpgintry/exceptlogic so that the modules can always be imported cleanlysecuresystemslib.gpgby raisingUnsupportedLibraryErrorwhen a function requiring a native module dependency is calledsecuresystemslib.gpginterfaces requiringgpg[2]or native module dependencies from our pure python test environmentPlease verify and check that the pull request fulfils the following
requirements: