2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-29 21:09:32 +00:00

Parse string arguments to nodes attributes as noderange

Since everywhere else accepts noderange, it is a reasonable
expectation for the nodes attribute on nodegroups to also
take a noderange.  Correct this inconsistency.
This commit is contained in:
Jarrod Johnson 2019-01-30 09:50:31 -05:00
parent 09cb6963f0
commit 8a5f1c6dc5
3 changed files with 13 additions and 8 deletions

View File

@ -1,7 +1,7 @@
7# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2014 IBM Corporation
# Copyright 2015-2018 Lenovo
# Copyright 2015-2019 Lenovo
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@ -1515,17 +1515,20 @@ class ConfigManager(object):
currnodes = list(self.get_nodegroup_attributes(
group, ['nodes']).get('nodes', []))
if attribmap[group][attr].get('prepend', False):
newnodes = attribmap[group][attr][
'prepend'].split(',')
attribmap[group][attr] = newnodes + currnodes
newnodes = noderange.NodeRange(attribmap[group][attr][
'prepend'], config=self).nodes
attribmap[group][attr] = list(
newnodes) + currnodes
elif attribmap[group][attr].get('remove', False):
delnodes = attribmap[group][attr][
'remove'].split(',')
delnodes = noderange.NodeRange(
attribmap[group][attr]['remove'],
config=self).nodes
attribmap[group][attr] = [
x for x in currnodes if x not in delnodes]
if not isinstance(attribmap[group][attr], list):
if type(attribmap[group][attr]) is unicode or type(attribmap[group][attr]) is str:
attribmap[group][attr]=attribmap[group][attr].split(",")
attribmap[group][attr] = noderange.NodeRange(
attribmap[group][attr], config=self).nodes
else:
raise ValueError("nodes attribute on group must be list")
for node in attribmap[group]['nodes']:

View File

@ -199,6 +199,8 @@ def _find_srvtype(net, net4, srvtype, addresses, xid):
net4.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
v6addrs = []
v6hash = _v6mcasthash(srvtype)
print(repr(srvtype))
print(repr(v6hash))
# do 'interface local' and 'link local'
# it shouldn't make sense, but some configurations work with interface
# local that do not work with link local

View File

@ -1,5 +1,5 @@
# Copyright 2014 IBM Corporation
# Copyright 2017 Lenovo
# Copyright 2017-2019 Lenovo
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.