fix bugs
diff --git a/plstackapi/openstack/siteagent.py b/plstackapi/openstack/siteagent.py
index 6837285..98fedae 100644
--- a/plstackapi/openstack/siteagent.py
+++ b/plstackapi/openstack/siteagent.py
@@ -8,10 +8,12 @@
def run(self):
driver = OpenStackDriver()
# fill in null tenant ids
- sites = Site.objects.filter(tenant_id=None)
+ sites = Site.objects.filter(tenant_id__in=[None, ''])
for site in sites:
# calling save() on the model should force the tenant_id to be set
site.driver = driver
+ site.caller = driver.admin_user
+ site.caller.user_id = site.caller.id
site.save()
if __name__ == '__main__':