Skip to content

Commit

Permalink
Merge pull request #13 from EGI-Federation/sites
Browse files Browse the repository at this point in the history
Loop only over existing sites
  • Loading branch information
enolfc authored Jul 8, 2024
2 parents 732691a + 2e89bf3 commit 4cabadf
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions fedcloud_vm_monitoring/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,21 +79,13 @@ def main(
"search_filter": ldap_search_filter,
}
)
sites = [site] if site else list_sites()
appdb = AppDB(vo)
appdb_sites = appdb.get_sites_for_vo()
fedcloudclient_sites = list_sites(vo)
sites = [site] if site else set(appdb_sites + fedcloudclient_sites)
for s in sites:
click.secho(f"[.] Checking VO {vo} at {s}", fg="blue", bold=True)
if not appdb.vo_check(s):
click.secho(
f"[-] WARNING: VO {vo} is not available at {s} in AppDB", fg="yellow"
)
site_monitor = SiteMonitor(s, vo, access_token, max_days, ldap_config)
if not site_monitor.vo_check():
click.secho(
f"[-] WARNING: VO {vo} is not available at {s} in fedcloudclient",
fg="yellow",
)
continue
try:
site_monitor.vm_monitor(delete)
except SiteMonitorException as e:
Expand Down

0 comments on commit 4cabadf

Please sign in to comment.