-
Notifications
You must be signed in to change notification settings - Fork 186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switch 'osc.conf.config' from dict to Options class with type checking #1387
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #1387 +/- ##
==========================================
+ Coverage 29.31% 30.35% +1.03%
==========================================
Files 47 49 +2
Lines 17291 17685 +394
==========================================
+ Hits 5069 5368 +299
- Misses 12222 12317 +95
☔ View full report in Codecov by Sentry. |
d85bd88
to
aad6a96
Compare
aad6a96
to
e824c8c
Compare
c82d18c
to
b77a01c
Compare
|
||
|
||
def apply_option_types(config, conffile=""): | ||
class Password(collections.UserString): |
Check warning
Code scanning / CodeQL
`__eq__` not overridden when adding attributes Warning
'__eq__'
_data
079140f
to
1046567
Compare
osc/connection.py
Outdated
|
||
if options.cafile or options.capath: | ||
ssl_context.load_verify_locations(cafile=options.cafile, capath=options.capath) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just tried this with capath=False
, which results in
...
File "/usr/lib/python3.11/site-packages/osc/connection.py", line 268, in http_request
ssl_context.load_verify_locations(cafile=options["cacert"], capath=False)
TypeError: capath should be a valid filesystem path
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... and with capath=""
, I get SSL Error: [X509: INVALID_DIRECTORY] invalid directory (_ssl.c:4154)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nevermind that. With capath=None
(which you default to) it works fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAIK False
is an invalid value. It should either hold a path or be None
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct. I hadn't seen how you read the config (and your default values) due to "large diff hidden".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct. I hadn't seen how you read the config (and your default values) due to "large diff hidden".
I've rendered docs for this pull request, that might be helpful too:
https://opensuse-commander.readthedocs.io/en/readthedocs-test/api/osc.conf.html
https://opensuse-commander.readthedocs.io/en/readthedocs-test/oscrc.html
abaa7ae
to
c5e4f04
Compare
One question about this change... so far, I've been using
|
It looks like it worked, but to be honest, I don't know if it was ever supported. If I broke something or if you need a good support for plugin configs, |
Sure, thanks for the quick reply! |
Fixes: #1371
Fixes: #1073
Obsoletes: #1377