blob: fda66bd2e00807bc385bce4ca1f3745e048e4729 [file] [log] [blame]
Sapan Bhatia24836f12013-08-27 10:16:05 -04001import os
2import base64
3from planetstack.config import Config
4
5class SyncExternalRoutes(SyncStep):
6 # XXX what does this provide?
Sapan Bhatia2ef36c82013-09-02 14:30:37 -04007 requested_interval = 86400 # This step is slow like a pig. Let's run it infrequently
8
Sapan Bhatia24836f12013-08-27 10:16:05 -04009 def call(self):
10 routes = self.manager.driver.get_external_routes()
11 subnets = self.manager.driver.shell.quantum.list_subnets()['subnets']
12 for subnet in subnets:
13 try:
14 self.manager.driver.add_external_route(subnet, routes)
15 except:
16 logger.log_exc("failed to add external route for subnet %s" % subnet)