Add tenant while get in update

Add tenant while calling get in update

Change-Id: I94e579264218fa456c84aedd916c1c2dec47f3d0
This commit is contained in:
Tao Zou 2024-07-19 17:04:13 +08:00
parent 14a9b16225
commit 1fa9910c1b

View File

@ -135,7 +135,8 @@ class NsxPolicyResourceBase(object, metaclass=abc.ABCMeta):
"""Helper for update function - ignore attrs without explicit value""" """Helper for update function - ignore attrs without explicit value"""
args = self._get_user_args(**kwargs) args = self._get_user_args(**kwargs)
resource_def = self.entry_def(nsx_version=self.version, **args) resource_def = self.entry_def(nsx_version=self.version, **args)
body = self.policy_api.get(resource_def) tenant = args.get('tenant', constants.POLICY_INFRA_TENANT)
body = self.policy_api.get(resource_def, tenant)
if body: if body:
resource_def.set_obj_dict(body) resource_def.set_obj_dict(body)