return computeNodeName in vOLT object
diff --git a/xos/core/xoslib/methods/volttenant.py b/xos/core/xoslib/methods/volttenant.py
index a927c3f..a1ae656 100644
--- a/xos/core/xoslib/methods/volttenant.py
+++ b/xos/core/xoslib/methods/volttenant.py
@@ -30,13 +30,24 @@
humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+ computeNodeName = serializers.SerializerMethodField("getComputeNodeName")
+
class Meta:
model = VOLTTenant
- fields = ('humanReadableName', 'id', 'provider_service', 'service_specific_id', 'vlan_id' )
+ fields = ('humanReadableName', 'id', 'provider_service', 'service_specific_id', 'vlan_id', 'computeNodeName' )
def getHumanReadableName(self, obj):
return obj.__unicode__()
+ def getComputeNodeName(self, obj):
+ vcpe = obj.vcpe
+ if not vcpe:
+ return None
+ sliver = vcpe.sliver
+ if not sliver:
+ return None
+ return sliver.node.name
+
class VOLTTenantList(XOSListCreateAPIView):
serializer_class = VOLTTenantIdSerializer