Do not catch and ignore network instantiation errors, as doing so lets them pass...
[plstackapi.git] / planetstack / openstack_observer / steps / sync_controller_networks.py
index ea888c7..655b07d 100644 (file)
@@ -18,14 +18,16 @@ class SyncControllerNetworks(OpenStackSyncStep):
     provides=[ControllerNetwork, Network]
 
     def alloc_subnet(self, uuid):
+        # 16 bits only
+        uuid_masked = uuid & 0xffff
         a = 10
-        b = uuid >> 32
-        c = uuid & 0xffffffff
-       d = 0
+        b = uuid_masked >> 8
+        c = uuid_masked & 0xff
+        d = 0
+
+        cidr = '%d.%d.%d.%d/24'%(a,b,c,d)
+        return cidr
 
-       cidr = '%d.%d.%d.%d/24'%(a,b,c,d)
-       return cidr
-       
 
     def fetch_pending(self, deleted):
         if (deleted):
@@ -68,15 +70,8 @@ class SyncControllerNetworks(OpenStackSyncStep):
             return
 
         if controller_network.network.owner and controller_network.network.owner.creator:
-            try:
-                # update manager context
-               # Bring back
-                self.save_controller_network(controller_network)
-                logger.info("saved network controller: %s" % (controller_network))
-            except Exception,e:
-                logger.log_exc("save network controller failed: %s" % controller_network)
-                raise e
-
+           self.save_controller_network(controller_network)
+           logger.info("saved network controller: %s" % (controller_network))
 
     def delete_record(self, controller_network):
         driver = OpenStackDriver().client_driver(caller=controller_network.network.owner.creator,