3 from planetstack.config import Config
4 from observer.openstacksyncstep import OpenStackSyncStep
5 from core.models.site import Deployment
7 class SyncExternalRoutes(OpenStackSyncStep):
8 # XXX what does this provide?
10 requested_interval = 86400 # This step is slow like a pig. Let's run it infrequently
12 def call(self, **args):
13 deployments = Deployment.objects.all()
14 self.driver = self.driver.admin_driver(deployment=deployments[0],tenant='admin')
15 routes = self.driver.get_external_routes()
16 subnets = self.driver.shell.quantum.list_subnets()['subnets']
17 for subnet in subnets:
19 self.driver.add_external_route(subnet, routes)
21 logger.log_exc("failed to add external route for subnet %s" % subnet)