Revision 8db31d6b
b/lib/config.py | ||
---|---|---|
206 | 206 |
self._temporary_ids.add(unique_id) |
207 | 207 |
return unique_id |
208 | 208 |
|
209 |
def _CleanupTemporaryIDs(self): |
|
210 |
"""Cleanups the _temporary_ids structure. |
|
211 |
|
|
212 |
""" |
|
213 |
existing = self._AllIDs(include_temporary=False) |
|
214 |
self._temporary_ids = self._temporary_ids - existing |
|
215 |
|
|
209 | 216 |
def _AllMACs(self): |
210 | 217 |
"""Return all MACs present in the config. |
211 | 218 |
|
... | ... | |
1114 | 1121 |
"""Write the configuration data to persistent storage. |
1115 | 1122 |
|
1116 | 1123 |
""" |
1124 |
# first, cleanup the _temporary_ids set, if an ID is now in the |
|
1125 |
# other objects it should be discarded to prevent unbounded growth |
|
1126 |
# of that structure |
|
1127 |
self._CleanupTemporaryIDs() |
|
1117 | 1128 |
config_errors = self._UnlockedVerifyConfig() |
1118 | 1129 |
if config_errors: |
1119 | 1130 |
raise errors.ConfigurationError("Configuration data is not" |
Also available in: Unified diff