blob: 6837285b485dbe7cdd2e55ba49c09ce2fc2b5fc4 [file] [log] [blame]
Tony Mackbd3b26e2013-04-30 17:43:48 -04001import os
2os.environ.setdefault("DJANGO_SETTINGS_MODULE", "plstackapi.planetstack.settings")
3import time
4from plstackapi.core.models.site import Site
5from plstackapi.openstack.driver import OpenStackDriver
6
7class SiteAgent:
8 def run(self):
9 driver = OpenStackDriver()
10 # fill in null tenant ids
11 sites = Site.objects.filter(tenant_id=None)
12 for site in sites:
13 # calling save() on the model should force the tenant_id to be set
14 site.driver = driver
15 site.save()
16
17if __name__ == '__main__':
18 SiteAgent().run()
19