allow tosca to run with no user
diff --git a/xos/tosca/resources/xosresource.py b/xos/tosca/resources/xosresource.py
index cc4672b..7a6c194 100644
--- a/xos/tosca/resources/xosresource.py
+++ b/xos/tosca/resources/xosresource.py
@@ -186,7 +186,8 @@
def create(self):
xos_args = self.get_xos_args()
xos_obj = self.xos_model(**xos_args)
- xos_obj.caller = self.user
+ if self.user:
+ xos_obj.caller = self.user
xos_obj.save()
self.info("Created %s '%s'" % (self.xos_model.__name__,str(xos_obj)))
diff --git a/xos/tosca/run.py b/xos/tosca/run.py
index 591582b..58dc22b 100644
--- a/xos/tosca/run.py
+++ b/xos/tosca/run.py
@@ -25,7 +25,10 @@
username = sys.argv[1]
template_name = sys.argv[2]
- u = User.objects.get(email=username)
+ if username.lower()=="none":
+ u=None
+ else:
+ u = User.objects.get(email=username)
xt = XOSTosca(file(template_name).read(), parent_dir=currentdir, log_to_console=True)
xt.execute(u)