do not destroy controller if it has active nodes
diff --git a/xos/tosca/resources/controller.py b/xos/tosca/resources/controller.py
index da4ed64..9a20ea5 100644
--- a/xos/tosca/resources/controller.py
+++ b/xos/tosca/resources/controller.py
@@ -44,6 +44,10 @@
if obj.controllersite.exists():
self.info("Controller %s has active sites; skipping delete" % obj.name)
return
+ for sd in obj.sitedeployments.all():
+ if sd.nodes.exists():
+ self.info("Controller %s has active nodes; skipping delete" % obj.name)
+ return
super(XOSController, self).delete(obj)