...instead of only doing changes locally. Doing changes
locally used to be fine---and even necessary---as long
as all calls to CommitTemporaryIPs used to be under
full configuration synchronisation.

Signed-off-by: Klaus Aehlig <[email protected]>
---
 lib/config/__init__.py | 30 ++----------------------------
 1 file changed, 2 insertions(+), 28 deletions(-)

diff --git a/lib/config/__init__.py b/lib/config/__init__.py
index 7b6187f..b1b4e97 100644
--- a/lib/config/__init__.py
+++ b/lib/config/__init__.py
@@ -620,34 +620,8 @@ class ConfigWriter(object):
 
   @ConfigSync(shared=1)
   def CommitTemporaryIps(self, _ec_id):
-    """A simple wrapper around L{_UnlockedCommitTemporaryIps}"""
-    self._UnlockedCommitTemporaryIps(_ec_id)
-
-  def _UnlockedCommitTemporaryIps(self, _ec_id):
-    """Commit all reserved IP address to their respective pools
-
-    """
-    if self._offline:
-      raise errors.ProgrammerError("Can't call CommitTemporaryIps"
-                                   " in offline mode")
-    ips = self._wconfd.ListReservedIps(self._GetWConfdContext())
-    for action, address, net_uuid in ips:
-      self._UnlockedCommitIp(action, net_uuid, address)
-
-  def _UnlockedCommitIp(self, action, net_uuid, address):
-    """Commit a reserved IP address to an IP pool.
-
-    The IP address is taken from the network's IP pool and marked as free.
-
-    """
-    nobj = self._UnlockedGetNetwork(net_uuid)
-    if nobj is None:
-      raise errors.ProgrammerError("Network '%s' not found" % (net_uuid, ))
-    pool = network.AddressPool(nobj)
-    if action == constants.RESERVE_ACTION:
-      pool.Reserve(address)
-    elif action == constants.RELEASE_ACTION:
-      pool.Release(address)
+    """Tell WConfD to commit all temporary ids"""
+    self._wconfd.CommitTemporaryIps(self._GetWConfdContext())
 
   def ReleaseIp(self, net_uuid, address, _ec_id):
     """Give a specific IP address back to an IP pool.
-- 
2.6.0.rc2.230.g3dd15c0

Reply via email to