display count of ready slivers in tenant view
diff --git a/planetstack/core/xoslib/objects/sliceplus.py b/planetstack/core/xoslib/objects/sliceplus.py
index 94174b4..d3e618d 100644
--- a/planetstack/core/xoslib/objects/sliceplus.py
+++ b/planetstack/core/xoslib/objects/sliceplus.py
@@ -19,6 +19,7 @@
def getSliceInfo(self, user=None):
if not self._sliceInfo:
used_sites = {}
+ ready_sites = {}
used_deployments = {}
sliverCount = 0
sshCommands = []
@@ -33,6 +34,8 @@
sshCommand = 'ssh -o "ProxyCommand ssh -q %s@%s" ubuntu@%s' % (sliver.instance_id, sliver.node.name, sliver.instance_name)
sshCommands.append(sshCommand);
+ ready_sites[site.name] = ready_sites.get(site.name, 0) + 1
+
users = {}
for priv in SlicePrivilege.objects.filter(slice=self):
if not (priv.user.id in users.keys()):
@@ -51,6 +54,7 @@
networkPorts = network.ports
self._sliceInfo= {"sitesUsed": used_sites,
+ "sitesReady": ready_sites,
"deploymentsUsed": used_deployments,
"sliverCount": sliverCount,
"siteCount": len(used_sites.keys()),
@@ -67,6 +71,14 @@
return self._sliceInfo
@property
+ def site_ready(self):
+ return self.getSliceInfo()["sitesReady"]
+
+ @site_ready.setter
+ def site_ready(self, value):
+ pass
+
+ @property
def site_allocation(self):
return self._site_allocation