Revision 5cfa6c37 lib/objects.py
b/lib/objects.py | ||
---|---|---|
2034 | 2034 |
__slots__ = [ |
2035 | 2035 |
"name", |
2036 | 2036 |
"serial_no", |
2037 |
"network_type", |
|
2038 | 2037 |
"mac_prefix", |
2039 | 2038 |
"family", |
2040 | 2039 |
"network", |
... | ... | |
2069 | 2068 |
result["%sNETWORK_GATEWAY6" % prefix] = self.gateway6 |
2070 | 2069 |
if self.mac_prefix: |
2071 | 2070 |
result["%sNETWORK_MAC_PREFIX" % prefix] = self.mac_prefix |
2072 |
if self.network_type: |
|
2073 |
result["%sNETWORK_TYPE" % prefix] = self.network_type |
|
2074 | 2071 |
|
2075 | 2072 |
return result |
2076 | 2073 |
|
2074 |
@classmethod |
|
2075 |
def FromDict(cls, val): |
|
2076 |
"""Custom function for networks. |
|
2077 |
|
|
2078 |
Remove deprecated network_type. Still this info can be passed via tags. |
|
2079 |
|
|
2080 |
""" |
|
2081 |
if "network_type" in val: |
|
2082 |
del val["network_type"] |
|
2083 |
obj = super(Network, cls).FromDict(val) |
|
2084 |
return obj |
|
2085 |
|
|
2077 | 2086 |
|
2078 | 2087 |
class SerializableConfigParser(ConfigParser.SafeConfigParser): |
2079 | 2088 |
"""Simple wrapper over ConfigParse that allows serialization. |
Also available in: Unified diff