filter sites with no nodes from tenant view
Scott Baker [Thu, 22 Jan 2015 23:16:34 +0000 (15:16 -0800)]
planetstack/core/xoslib/methods/tenantview.py

index d7460da..44db514 100644 (file)
@@ -19,7 +19,11 @@ def getTenantViewDict(user):
         good=False
         for deployment in site.deployments.all():
             if deployment.name in BLESSED_DEPLOYMENTS:
-                good=True
+                # only bless sites that have at least one node in the deployment
+                sitedeployments = SiteDeployment.objects.filter(site=site, deployment=deployment)
+                for sd in sitedeployments.all():
+                    if sd.nodes.count()>0:
+                        good=True
         if good:
             blessed_sites.append(site)