Skip to content
Snippets Groups Projects
Commit d69521c9 authored by Tim Jaacks's avatar Tim Jaacks
Browse files

Refactoring: simplify conditional logic

See for reference:
https://docs.sourcery.ai/Reference/Python/Default-Rules/de-morgan/
parent 5c23592f
No related branches found
No related tags found
1 merge request!288Refactoring: simplify conditional logic
Pipeline #72184 skipped with stage
...@@ -27,7 +27,6 @@ rule_settings: ...@@ -27,7 +27,6 @@ rule_settings:
- for-append-to-extend - for-append-to-extend
- raise-specific-error - raise-specific-error
- simplify-len-comparison - simplify-len-comparison
- de-morgan
- use-named-expression - use-named-expression
- use-next - use-next
......
...@@ -94,7 +94,7 @@ def main(args): ...@@ -94,7 +94,7 @@ def main(args):
for job in job_it: for job in job_it:
if options.filter_status is not None and job.status != options.filter_status: if options.filter_status is not None and job.status != options.filter_status:
continue continue
if options.filter_tag is not None and not options.filter_tag in job.tag_list: if options.filter_tag is not None and options.filter_tag not in job.tag_list:
continue continue
log = bytes.decode(job.trace()) log = bytes.decode(job.trace())
if options.pattern in log: if options.pattern in log:
......
...@@ -87,7 +87,7 @@ def main(args): ...@@ -87,7 +87,7 @@ def main(args):
continue continue
if options.filter_status is not None and job.status != options.filter_status: if options.filter_status is not None and job.status != options.filter_status:
continue continue
if options.filter_tag is not None and not options.filter_tag in job.tag_list: if options.filter_tag is not None and options.filter_tag not in job.tag_list:
continue continue
job.delete_artifacts() job.delete_artifacts()
logging.debug( logging.debug(
......
...@@ -59,7 +59,7 @@ def get_lava_credentials(host=None): ...@@ -59,7 +59,7 @@ def get_lava_credentials(host=None):
if new_data: if new_data:
valid = {"yes": True, "ye": True, "y": True, "": True, "no": False, "n": False} valid = {"yes": True, "ye": True, "y": True, "": True, "no": False, "n": False}
choice = None choice = None
while not choice in valid: while choice not in valid:
sys.stdout.write( sys.stdout.write(
"Do you want to save these credentials in '%s'? " "[Y/n] " % configfile "Do you want to save these credentials in '%s'? " "[Y/n] " % configfile
) )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment