blob: 334d19d6ad53f33f2711528ea432dabe36d359de [file] [log] [blame]
Sapan Bhatia24836f12013-08-27 10:16:05 -04001import os
2import base64
3from planetstack.config import Config
Tony Mack66646d52013-09-24 21:47:12 -04004from observer.openstacksyncstep import OpenStackSyncStep
Sapan Bhatia24836f12013-08-27 10:16:05 -04005
Tony Mack66646d52013-09-24 21:47:12 -04006class SyncExternalRoutes(OpenStackSyncStep):
7 # XXX what does this provide?
8 provides=[]
9 requested_interval = 86400 # This step is slow like a pig. Let's run it infrequently
Sapan Bhatia2ef36c82013-09-02 14:30:37 -040010
Tony Macka76b8952013-10-05 23:36:30 -040011 def call(self, **args):
Tony Mack66646d52013-09-24 21:47:12 -040012 routes = self.driver.get_external_routes()
13 subnets = self.driver.shell.quantum.list_subnets()['subnets']
14 for subnet in subnets:
15 try:
16 self.driver.add_external_route(subnet, routes)
17 except:
18 logger.log_exc("failed to add external route for subnet %s" % subnet)