mirror of
https://github.com/xcat2/confluent.git
synced 2024-11-26 11:30:23 +00:00
Add understanding of net.* attributes to fixup
net.* are special, add them to the fxup so that the bootable attribute is correctly amended.
This commit is contained in:
parent
de30c53d21
commit
5cd461c6ad
@ -227,6 +227,12 @@ def decrypt_value(cryptvalue,
|
||||
|
||||
def fixup_attribute(attrname, attrval):
|
||||
# Normalize some data, for example strings and numbers to bool
|
||||
if attrname.startswith('net.'):
|
||||
# For net.* attribtues, split on the dots and put back together
|
||||
# longer term we might want a generic approach, but
|
||||
# right now it's just net. attributes
|
||||
netattrparts = attrname.split('.')
|
||||
attrname = netattrparts[0] + '.' + netattrparts[-1]
|
||||
if not isinstance(attrval, allattributes.node[attrname]['type']):
|
||||
if (allattributes.node[attrname]['type'] == bool and
|
||||
(isinstance(attrval, str) or isinstance(attrval, unicode))):
|
||||
|
Loading…
Reference in New Issue
Block a user