+ if not opts.site:
+ # NOTE: for all sites in DB but not API, call zabbixsite.delete_site()
+ hg_list = filter(lambda x: '_hostgroup' in x.name, HostGroup.query.all() )
+ site_db_list = [ hg.name[:-len('_hostgroup')] for hg in hg_list ]
+ in_db_not_plc = set(site_db_list) - set(site_api_list)
+ for login_base in in_db_not_plc:
+ print "Deleting %s" % login_base
+ zabbixsite.delete_site(site['login_base'])
+