Skip to content

Commit

Permalink
Fixed error because items can be none, empty list, or list with content
Browse files Browse the repository at this point in the history
  • Loading branch information
svarona committed Jul 1, 2024
1 parent 8869811 commit dc5dc82
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions bu_isciii/clean.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,16 +129,16 @@ def get_clean_items(self, services_ids, type="files"):
for service in services_ids:
try:
items = service_conf.get_find_deep(service, type)
if items:
for item in items:
if item not in clean_items_list:
clean_items_list.append(item)
else:
if items is None:
stderr.print(
"[red]ERROR: Service type %s not found in services json file for service %s."
% (type, service)
)
sys.exit()
else:
for item in items:
if item not in clean_items_list:
clean_items_list.append(item)
except KeyError as e:
stderr.print(
"[red]ERROR: Service id %s not found in services json file."
Expand Down

0 comments on commit dc5dc82

Please sign in to comment.