def cluster_interface(self):
"""
Check that storage nodes have an interface on the cluster network
"""
# pylint: disable=too-many-nested-blocks
for node in self.data.keys():
if ('roles' in self.data[node] and
'storage' in self.data[node]['roles']):
found = False
cluster_network = self.data[node].get("cluster_network", "")
net_list = Util.parse_list_from_string(cluster_network)
for address in self.grains[node]['ipv4']:
try:
for network in net_list:
addr = ipaddress.ip_address(u'{}'.format(address))
net = ipaddress.ip_network(u'{}'.format(network))
if addr in net:
found = True
except ValueError:
# Don't care about reporting a ValueError here if
# cluster_network is malformed, because the
# previous validation in cluster_network() will do that.
pass
if not found:
msg = "minion {}".format(node)
msg += " missing address on cluster network {}".format(cluster_network)
self.errors.setdefault('cluster_interface', []).append(msg)
self._set_pass_status('cluster_interface')
评论列表
文章目录