cleanup a few remaining reference to NetworkInstances
diff --git a/xos/core/models/network.py b/xos/core/models/network.py
index 1258d76..fe60fce 100644
--- a/xos/core/models/network.py
+++ b/xos/core/models/network.py
@@ -207,9 +207,6 @@
return qs
class Port(PlCoreBase):
- # Please use "Port" instead of "NetworkInstance". NetworkInstance will soon be
- # removed.
-
network = models.ForeignKey(Network,related_name='links')
instance = models.ForeignKey(Instance, null=True, blank=True, related_name='ports')
ip = models.GenericIPAddressField(help_text="Instance ip address", blank=True, null=True)
diff --git a/xos/core/xoslib/methods/hpcview.py b/xos/core/xoslib/methods/hpcview.py
index f14b398..1118eda 100644
--- a/xos/core/xoslib/methods/hpcview.py
+++ b/xos/core/xoslib/methods/hpcview.py
@@ -84,7 +84,7 @@
if (network_name is None) or (network_name=="") or (network_name.lower()=="public"):
return instance.get_public_ip()
- for ns in instance.networkinstances.all():
+ for ns in instance.ports.all():
if (ns.ip) and (ns.network.name==network_name):
return ns.ip
diff --git a/xos/tools/get_instance_ip.py b/xos/tools/get_instance_ip.py
index dd3c788..1783b25 100644
--- a/xos/tools/get_instance_ip.py
+++ b/xos/tools/get_instance_ip.py
@@ -71,7 +71,7 @@
instance_id = instances[-1]["id"]
- r = requests.get(NETWORKINSTANCES_API + "?instance=%s" % instance_id, auth=opencloud_auth)
+ r = requests.get(PORTS_API + "?instance=%s" % instance_id, auth=opencloud_auth)
ports = r.json()
ips = [x["ip"] for x in ports]