Merge "Fix sssd IPv6 address detection in DC system"
This commit is contained in:
commit
4113002522
@ -8,8 +8,6 @@ from oslo_log import log as logging
|
|||||||
from sysinv.puppet import base
|
from sysinv.puppet import base
|
||||||
from sysinv.common import constants
|
from sysinv.common import constants
|
||||||
|
|
||||||
import netaddr
|
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
@ -154,19 +152,12 @@ class SssdPuppet(base.BasePuppet):
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
def _get_network_type(self):
|
def _get_network_type(self):
|
||||||
if self._distributed_cloud_role() == \
|
return self.dbapi.network_get_by_type(constants.NETWORK_TYPE_MGMT)
|
||||||
constants.DISTRIBUTED_CLOUD_ROLE_SYSTEMCONTROLLER:
|
|
||||||
return self.dbapi.network_get_by_type(
|
|
||||||
constants.NETWORK_TYPE_SYSTEM_CONTROLLER)
|
|
||||||
else:
|
|
||||||
return self.dbapi.network_get_by_type(constants.NETWORK_TYPE_MGMT)
|
|
||||||
|
|
||||||
def _is_host_address_ipv6(self):
|
def _is_host_address_ipv6(self):
|
||||||
addr_pool = self.dbapi.address_pool_get(self._get_network_type().pool_uuid)
|
addr_pool = self.dbapi.address_pool_get(self._get_network_type().pool_uuid)
|
||||||
floating_addr = addr_pool.floating_address
|
|
||||||
addr = netaddr.IPAddress(floating_addr)
|
|
||||||
|
|
||||||
if addr.version == constants.IPV6_FAMILY:
|
if addr_pool.family == constants.IPV6_FAMILY:
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
|
Loading…
Reference in New Issue
Block a user