Skip to content

Commit

Permalink
amg: bug fix on excluding general folder (#6307)
Browse files Browse the repository at this point in the history
* amg: fix a bug on excluding General folder

* bug fixe and add test
  • Loading branch information
yugangw-msft authored May 23, 2023
1 parent 2132c44 commit 355b233
Show file tree
Hide file tree
Showing 4 changed files with 2,537 additions and 1,774 deletions.
7 changes: 5 additions & 2 deletions src/amg/azext_amg/backup.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,11 @@ def _save_dashboards(grafana_url, backup_dir, timestamp, http_headers, **kwargs)
not d.get('folderTitle', '') and 'general' in folders_to_include)]
if folders_to_exclude:
folders_to_exclude = [f.lower() for f in folders_to_exclude]
dashboards = [d for d in dashboards if (d.get('folderTitle', '').lower() not in folders_to_exclude or
d.get('folderTitle', '') and 'general' in folders_to_exclude)]
dashboards = [d for d in dashboards if ((d.get('folderTitle', '')
and d.get('folderTitle', '').lower() not in folders_to_exclude)
or
(not d.get('folderTitle', '')
and 'general' not in folders_to_exclude))]

_print_an_empty_line()
if len(dashboards) == 0:
Expand Down
Loading

0 comments on commit 355b233

Please sign in to comment.