mirror of
https://github.com/xcat2/confluent.git
synced 2024-11-22 01:22:00 +00:00
Prevent bulk renames from stomping on itself
If multiple things try to renam to the same thing, block the action.
This commit is contained in:
parent
367854128a
commit
130fce0320
@ -2186,6 +2186,8 @@ class ConfigManager(object):
|
||||
','.join(missingnodes)))
|
||||
newnames = set([])
|
||||
for name in renamemap:
|
||||
if renamemap[name] in newnames:
|
||||
raise ValueError('Requested to rename multiple nodes to the same name: {0}'.format(renamemap[name]))
|
||||
newnames.add(renamemap[name])
|
||||
if newnames & currnodes:
|
||||
raise ValueError(
|
||||
@ -2230,6 +2232,8 @@ class ConfigManager(object):
|
||||
','.join(missinggroups)))
|
||||
newnames = set([])
|
||||
for name in renamemap:
|
||||
if renamemap[name] in newnames:
|
||||
raise ValueError('Requested to rename multiple groups to the same name: {0}'.format(name))
|
||||
newnames.add(renamemap[name])
|
||||
if newnames & currgroups:
|
||||
raise ValueError(
|
||||
|
Loading…
Reference in New Issue
Block a user