Revision 34d657ba lib/config.py

b/lib/config.py
207 207
    self._temporary_ids.add(unique_id)
208 208
    return unique_id
209 209

  
210
  def _CleanupTemporaryIDs(self):
211
    """Cleanups the _temporary_ids structure.
212

  
213
    """
214
    existing = self._AllIDs(include_temporary=False)
215
    self._temporary_ids = self._temporary_ids - existing
216

  
210 217
  def _AllMACs(self):
211 218
    """Return all MACs present in the config.
212 219

  
......
1119 1126
    """Write the configuration data to persistent storage.
1120 1127

  
1121 1128
    """
1129
    # first, cleanup the _temporary_ids set, if an ID is now in the
1130
    # other objects it should be discarded to prevent unbounded growth
1131
    # of that structure
1132
    self._CleanupTemporaryIDs()
1122 1133
    config_errors = self._UnlockedVerifyConfig()
1123 1134
    if config_errors:
1124 1135
      raise errors.ConfigurationError("Configuration data is not"

Also available in: Unified diff