Sapan Bhatia | 26d40bc | 2014-05-12 15:28:02 -0400 | [diff] [blame] | 1 | import os |
| 2 | import base64 |
| 3 | from planetstack.config import Config |
| 4 | from observer.syncstep import SyncStep |
| 5 | |
| 6 | class 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) |