mirror of
https://github.com/xcat2/confluent.git
synced 2026-01-11 18:42:29 +00:00
Use IPv4 address for ikvm when fe80 is the local bmc
The fe80:: is hopeless, try to send ipv4 just in case. Technically speaking, the user may be using a different address or real ipv6 and the ipv4 guess might fail, but it probably won't.
This commit is contained in:
@@ -1669,6 +1669,9 @@ class IpmiHandler(object):
|
||||
launchdata = self.ipmicmd.get_ikvm_launchdata()
|
||||
if 'url' in launchdata and not launchdata['url'].startswith('https://'):
|
||||
mybmc = self.ipmicmd.confluentbmcname
|
||||
if mybmc.startswith('fe80::'): # link local, need to adjust
|
||||
lancfg = self.ipmicmd.get_net_configuration()
|
||||
mybmc = lancfg['ipv4_address'].split('/')[0]
|
||||
if ':' in mybmc and not '[' in mybmc:
|
||||
mybmc = '[{}]'.format(mybmc)
|
||||
launchdata['url'] = 'https://{}{}'.format(mybmc, launchdata['url'])
|
||||
|
||||
@@ -1526,6 +1526,9 @@ class IpmiHandler(object):
|
||||
launchdata = self.ipmicmd.get_ikvm_launchdata()
|
||||
if 'url' in launchdata and not launchdata['url'].startswith('https://'):
|
||||
mybmc = self.ipmicmd.confluentbmcname
|
||||
if mybmc.startswith('fe80::'): # link local, need to adjust
|
||||
lancfg = self.ipmicmd.get_net_configuration()
|
||||
mybmc = lancfg['ipv4_address'].split('/')[0]
|
||||
if ':' in mybmc and not '[' in mybmc:
|
||||
mybmc = '[{}]'.format(mybmc)
|
||||
launchdata['url'] = 'https://{}{}'.format(mybmc, launchdata['url'])
|
||||
|
||||
Reference in New Issue
Block a user