diff --git a/openshift/helper/base.py b/openshift/helper/base.py index c10551e0..1fe5ca3f 100644 --- a/openshift/helper/base.py +++ b/openshift/helper/base.py @@ -175,7 +175,7 @@ def has_method(self, method_action): return method is not None def fix_serialization(self, obj): - if obj and obj.kind == "Service": + if obj and obj.kind == "Service" and obj.spec.ports: for port in obj.spec.ports: try: port.target_port = int(port.target_port)