Skip to content

Commit

Permalink
with pre-commit run
Browse files Browse the repository at this point in the history
  • Loading branch information
joel5vega committed Dec 20, 2023
1 parent 3364e41 commit 7c1f166
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/sugar/sugar.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ def _check_config_file(self):
def _filter_service_group(self):
groups = self.config['groups']


if not self.args.get('service_group'):
default_group = self.defaults.get('group')
if not default_group:
Expand All @@ -136,8 +135,7 @@ def _filter_service_group(self):

default_project_name = self.defaults.get('project-name')

for group_name,group_data in groups.items():

for group_name, group_data in groups.items():
if group_name == selected_group_name:
if default_project_name and 'project-name' not in group_data:
# just use default value if "project-name" is not set
Expand All @@ -147,9 +145,13 @@ def _filter_service_group(self):
# use as default all the services available
default_services = [
service['name']
for service in group_data.get('services', {}).get('available')
for service in group_data.get('services', {}).get(
'available'
)
]
group_data['services']['default'] = ','.join(default_services)
group_data['services']['default'] = ','.join(
default_services
)
self.service_group = group_data
return

Expand Down

0 comments on commit 7c1f166

Please sign in to comment.