-
Notifications
You must be signed in to change notification settings - Fork 175
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
36 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -385,14 +385,35 @@ def _deploy(self, dashboard_id: str=None, recursive=True, update=False, **kwargs | |
|
||
|
||
if dashboard_id is None: | ||
dashboard_id = get_parameter( | ||
param_name='dashboard-id', | ||
message="Please select dashboard to install", | ||
choices={ | ||
f"[{dashboard.get('dashboardId')}] {dashboard.get('name')}" : dashboard.get('dashboardId') | ||
for k, dashboard in self.resources.get('dashboards').items() | ||
}, | ||
) | ||
while True: | ||
Check notice Code scanning / CodeGuru Reviewer Scanner Complex code hard to maintain Low
Comprehensions for list, dict, and set with more than two control subexpressions can be difficult to understand so should be avoided. The following is an example of using a comprehension with four control statements: [y.upper() for x in text if len(x) == 3 for y in x if y.startswith('f')].
Learn more Similar issue at line numbers 392 and 402. |
||
category_options = ['Foundational', 'Advanced', 'Additional'] + \ | ||
sorted(list(set([ | ||
f"{dashboard.get('category', 'Custom')}" | ||
for k, dashboard in self.resources.get('dashboards').items() | ||
if f"{dashboard.get('category', 'Custom')}" not in ('Foundational', 'Advanced', 'Additional') | ||
]))) | ||
category = get_parameter( | ||
param_name='category', | ||
message="Please select a category of dashboard to install", | ||
choices=category_options, | ||
) | ||
print(category) | ||
dashboard_options = { | ||
f"[{dashboard.get('dashboardId')}] {dashboard.get('name')}" : dashboard.get('dashboardId') | ||
for k, dashboard in self.resources.get('dashboards').items() | ||
if dashboard.get('category', 'Custom') == category | ||
} | ||
dashboard_options['<<< back'] = '<<< back' | ||
dashboard_id = get_parameter( | ||
param_name='dashboard-id', | ||
message="Please select dashboard to install", | ||
choices=dashboard_options, | ||
) | ||
if dashboard_id != '<<< back': | ||
break | ||
unset_parameter('category') | ||
unset_parameter('dashboard-id') | ||
|
||
if not dashboard_id: | ||
print('No dashboard selected') | ||
return | ||
|
1 change: 1 addition & 0 deletions
1
dashboards/sustainability-proxy-metrics/sustainability-proxy-metrics.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
dashboards: | ||
SUS-DASH: | ||
category: 'Additional' | ||
dependsOn: | ||
datasets: | ||
- aws_regions | ||
|