Policy make edge cluster & transport zones optional

Commit I98ebb3130a3f6e62d36895a6709d33683d9e6093 added the
communication parameters to the policy enformcment point
This patch also handles the case of null values for the new
parameters

Change-Id: I192b891be23a4cde4e43284affb4040442b4f798
This commit is contained in:
Adit Sarfaty 2018-03-19 14:44:29 +02:00
parent f680a5acd2
commit 79577e955e
1 changed files with 7 additions and 2 deletions

View File

@ -492,9 +492,14 @@ class EnforcementPointDef(ResourceDef):
'username': self.username,
'password': self.password,
'enforcement_point_address': self.ip_address,
'edge_cluster_ids': [self.edge_cluster_id],
'transport_zone_ids': [self.transport_zone_id],
'resource_type': 'NSXTConnectionInfo'}
if self.edge_cluster_id:
body['connection_info']['edge_cluster_ids'] = [
self.edge_cluster_id]
if self.transport_zone_id:
body['connection_info']['transport_zone_ids'] = [
self.transport_zone_id]
body['resource_type'] = 'EnforcementPoint'
return body