Merge "Nsx policy: adjust to latest backend changes"
This commit is contained in:
commit
b6b45f0ac2
@ -337,5 +337,5 @@ class TestPolicyDeploymentMap(TestPolicyApi):
|
|||||||
'enforcement_point_path': ep_path}
|
'enforcement_point_path': ep_path}
|
||||||
|
|
||||||
self.assert_json_call('POST', self.client,
|
self.assert_json_call('POST', self.client,
|
||||||
'infra/domains/d1/domaindeploymentmaps/dm1',
|
'infra/domains/d1/domain-deployment-maps/dm1',
|
||||||
data=expected_data)
|
data=expected_data)
|
||||||
|
@ -205,7 +205,7 @@ class TestPolicyGroup(NsxPolicyLibTestCase):
|
|||||||
description = 'desc'
|
description = 'desc'
|
||||||
cond_val = '123'
|
cond_val = '123'
|
||||||
cond_op = policy_constants.CONDITION_OP_EQUALS
|
cond_op = policy_constants.CONDITION_OP_EQUALS
|
||||||
cond_member_type = policy_constants.CONDITION_MEMBER_NET
|
cond_member_type = policy_constants.CONDITION_MEMBER_VM
|
||||||
cond_key = policy_constants.CONDITION_KEY_TAG
|
cond_key = policy_constants.CONDITION_KEY_TAG
|
||||||
with mock.patch.object(self.policy_api,
|
with mock.patch.object(self.policy_api,
|
||||||
"create_or_update") as api_call:
|
"create_or_update") as api_call:
|
||||||
@ -1216,8 +1216,8 @@ class TestPolicyDeploymentMap(NsxPolicyLibTestCase):
|
|||||||
expected_def = policy_defs.DeploymentMapDef(map_id=id,
|
expected_def = policy_defs.DeploymentMapDef(map_id=id,
|
||||||
tenant=TEST_TENANT)
|
tenant=TEST_TENANT)
|
||||||
domain_path = "/%s/domains/%s" % (TEST_TENANT, domain_id)
|
domain_path = "/%s/domains/%s" % (TEST_TENANT, domain_id)
|
||||||
ep_path = ("/%s/deploymentzones/default/"
|
ep_path = ("/%s/deployment-zones/default/"
|
||||||
"enforcementpoints/%s" % (TEST_TENANT, ep_id))
|
"enforcement-points/%s" % (TEST_TENANT, ep_id))
|
||||||
expected_dict = {'display_name': name,
|
expected_dict = {'display_name': name,
|
||||||
'enforcement_point_paths': [ep_path],
|
'enforcement_point_paths': [ep_path],
|
||||||
'domain_path': domain_path}
|
'domain_path': domain_path}
|
||||||
|
@ -19,14 +19,13 @@ UDP = 'UDP'
|
|||||||
POLICY_INFRA_TENANT = 'infra'
|
POLICY_INFRA_TENANT = 'infra'
|
||||||
|
|
||||||
ACTION_ALLOW = 'ALLOW'
|
ACTION_ALLOW = 'ALLOW'
|
||||||
ACTION_DENY = 'DENY'
|
ACTION_DENY = 'DROP'
|
||||||
|
|
||||||
ANY_GROUP = 'ANY'
|
ANY_GROUP = 'ANY'
|
||||||
|
|
||||||
CONDITION_KEY_TAG = 'Tag'
|
CONDITION_KEY_TAG = 'Tag'
|
||||||
CONDITION_MEMBER_VM = 'VirtualMachine'
|
CONDITION_MEMBER_VM = 'VirtualMachine'
|
||||||
CONDITION_MEMBER_PORT = 'LogicalPort'
|
CONDITION_MEMBER_PORT = 'LogicalPort'
|
||||||
CONDITION_MEMBER_NET = 'LogicalSwitch'
|
|
||||||
CONDITION_OP_EQUALS = 'EQUALS'
|
CONDITION_OP_EQUALS = 'EQUALS'
|
||||||
CONDITION_OP_CONTAINS = 'CONTAINS'
|
CONDITION_OP_CONTAINS = 'CONTAINS'
|
||||||
CONDITION_OP_STARTS_WITH = 'STARTSWITH'
|
CONDITION_OP_STARTS_WITH = 'STARTSWITH'
|
||||||
|
@ -519,7 +519,7 @@ class EnforcementPointDef(ResourceDef):
|
|||||||
@property
|
@property
|
||||||
def path_pattern(self):
|
def path_pattern(self):
|
||||||
return (TENANTS_PATH_PATTERN +
|
return (TENANTS_PATH_PATTERN +
|
||||||
'deploymentzones/default/enforcementpoints/')
|
'deployment-zones/default/enforcement-points/')
|
||||||
|
|
||||||
def get_obj_dict(self):
|
def get_obj_dict(self):
|
||||||
body = super(EnforcementPointDef, self).get_obj_dict()
|
body = super(EnforcementPointDef, self).get_obj_dict()
|
||||||
@ -575,7 +575,7 @@ class DeploymentMapDef(ResourceDef):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def path_pattern(self):
|
def path_pattern(self):
|
||||||
return (DOMAINS_PATH_PATTERN + '%s/domaindeploymentmaps/')
|
return (DOMAINS_PATH_PATTERN + '%s/domain-deployment-maps/')
|
||||||
|
|
||||||
def get_obj_dict(self):
|
def get_obj_dict(self):
|
||||||
body = super(DeploymentMapDef, self).get_obj_dict()
|
body = super(DeploymentMapDef, self).get_obj_dict()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user