2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-12-24 12:11:52 +00:00

Have nodeattrib and nodeconfig accept wildcard to select values

This commit is contained in:
Jarrod Johnson 2018-08-30 10:14:03 -04:00
parent 46d62e67de
commit 368087fb51

View File

@ -17,6 +17,7 @@
import anydbm as dbm
import errno
import fnmatch
import hashlib
import os
import shlex
@ -311,7 +312,7 @@ def attrrequested(attr, attrlist, seenattributes):
candidate = candidate.replace('hm', 'hardwaremanagement', 1)
if candidate in _attraliases:
candidate = _attraliases[candidate]
if candidate.lower() == attr.lower():
if fnmatch.fnmatch(attr.lower(), candidate.lower()):
seenattributes.add(truename)
return True
elif attr.lower().startswith(candidate.lower() + '.'):