diff --git a/vmware_nsxlib/v3/policy_constants.py b/vmware_nsxlib/v3/policy_constants.py index 8fbe154e..ad1aff0e 100644 --- a/vmware_nsxlib/v3/policy_constants.py +++ b/vmware_nsxlib/v3/policy_constants.py @@ -21,7 +21,7 @@ POLICY_INFRA_TENANT = 'infra' ACTION_ALLOW = 'ALLOW' ACTION_DENY = 'DENY' -ANY_GROUP = "ANY" +ANY_GROUP = 'ANY' CONDITION_KEY_TAG = 'Tag' CONDITION_MEMBER_VM = 'VirtualMachine' diff --git a/vmware_nsxlib/v3/policy_defs.py b/vmware_nsxlib/v3/policy_defs.py index 7536a31e..b5e4482f 100644 --- a/vmware_nsxlib/v3/policy_defs.py +++ b/vmware_nsxlib/v3/policy_defs.py @@ -89,11 +89,11 @@ class ResourceDef(object): entries_path = cls.sub_entries_path() if not entries_path: # This sub class doesn't support this - return None + return if (entries_path not in obj_body or len(obj_body[entries_path]) != 1): - return None + return return obj_body[entries_path][0] diff --git a/vmware_nsxlib/v3/policy_resources.py b/vmware_nsxlib/v3/policy_resources.py index c6dbf66b..7f1443aa 100644 --- a/vmware_nsxlib/v3/policy_resources.py +++ b/vmware_nsxlib/v3/policy_resources.py @@ -323,7 +323,7 @@ class NsxPolicyCommunicationProfileApi(NsxPolicyResourceBase): def create(self, name, profile_id=None, description=None, services=None, action=policy_constants.ACTION_ALLOW, tenant=policy_constants.POLICY_INFRA_TENANT): - """Create a Communication proflie with a single entry. + """Create a Communication profile with a single entry. Services should be a list of service ids """ @@ -561,7 +561,7 @@ class NsxPolicyEnforcementPointApi(NsxPolicyResourceBase): def update(self, ep_id, name=None, description=None, ip_address=None, username=None, password=None, tenant=policy_constants.POLICY_INFRA_TENANT): - """Update the enforcment point. + """Update the enforcement point. username & password must be defined """