Fix bug 1216: Remove machines only for native charms
[osm/N2VC.git] / n2vc / kubectl.py
index 9d4ce57..61b2dc3 100644 (file)
@@ -46,7 +46,9 @@ class Kubectl:
                             "target_port": p.target_port,
                         }
                         for p in i.spec.ports
-                    ],
+                    ]
+                    if i.spec.ports
+                    else [],
                     "external_ip": [i.ip for i in i.status.load_balancer.ingress]
                     if i.status.load_balancer.ingress
                     else None,