blob: 1e1a347ab3f2a47cd51f57dc2d76301b2c1fe200 [file] [log] [blame]
Sapan Bhatia26d40bc2014-05-12 15:28:02 -04001import os
2import base64
3from planetstack.config import Config
4from observer.syncstep import SyncStep
5
6class SyncExternalRoutes(SyncStep):
7 # XXX what does this provide?
8 provides=[]
9 requested_interval = 86400 # This step is slow like a pig. Let's run it infrequently
10
11 def call(self, **args):
12 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)