Merge "Standalone: Generate port map in a new format"

This commit is contained in:
Zuul 2022-11-24 09:04:56 +00:00 committed by Gerrit Code Review
commit ff717093ee
1 changed files with 33 additions and 0 deletions

View File

@ -316,6 +316,11 @@ class Deploy(command.Command):
}
return data
def _ip_for_uri(self, ip_addr, ip_nw):
if ip_nw.version == 6:
return '[%s]' % ip_addr
return ip_addr
def _generate_portmap_parameters(self, ip_addr, ip_nw, ctlplane_vip_addr,
public_vip_addr, stack_name='standalone',
role_name='Standalone'):
@ -357,6 +362,34 @@ class Deploy(command.Command):
'ip_version': ip_nw.version}],
'network': {'tags': [str(ip_nw.cidr)]}
}
},
'NodePortMap': {
hostname: {
'ctlplane': {
'ip_address': ip_addr,
'ip_address_uri': self._ip_for_uri(ip_addr, ip_nw),
'ip_subnet': '%s/%s' % (ip_addr, ip_nw.prefixlen)
}
}
},
'ControlPlaneVipData': {
'fixed_ips': [
{'ip_address': ctlplane_vip_addr}
],
'name': 'control_virtual_ip',
'network': {
'tags': ['%s/%s' % (ctlplane_vip_addr, ip_nw.prefixlen)]
},
'subnets': [
{'ip_version': ip_nw.version}
]
},
'VipPortMap': {
'external': {
'ip_address': public_vip_addr,
'ip_address_uri': self._ip_for_uri(public_vip_addr, ip_nw),
'ip_subnet': '%s/%s' % (public_vip_addr, ip_nw.prefixlen)
}
}
}
return data