blob: 6c22c8b51d48b86c98d91c2ce8404d0b95361ec3 [file] [log] [blame]
Sapan Bhatia24836f12013-08-27 10:16:05 -04001import os
2import base64
3from planetstack.config import Config
Sapan Bhatia04c94ad2013-09-02 18:00:28 -04004from observer.syncstep import SyncStep
Sapan Bhatia24836f12013-08-27 10:16:05 -04005
6class SyncExternalRoutes(SyncStep):
7 # XXX what does this provide?
Sapan Bhatia2ef36c82013-09-02 14:30:37 -04008 requested_interval = 86400 # This step is slow like a pig. Let's run it infrequently
9
Sapan Bhatia04c94ad2013-09-02 18:00:28 -040010 def __init__(self):
11 pass
12
Sapan Bhatia24836f12013-08-27 10:16:05 -040013 def call(self):
14 routes = self.manager.driver.get_external_routes()
Sapan Bhatia04c94ad2013-09-02 18:00:28 -040015 subnets = self.manager.driver.shell.quantum.list_subnets()['subnets']
16 for subnet in subnets:
17 try:
18 self.manager.driver.add_external_route(subnet, routes)
19 except:
20 logger.log_exc("failed to add external route for subnet %s" % subnet)