Commit 2856f939 by Őry Máté

one: more secure one_delete

parent aca6c74c
...@@ -559,9 +559,10 @@ class Instance(models.Model): ...@@ -559,9 +559,10 @@ class Instance(models.Model):
def one_delete(self): def one_delete(self):
"""Delete host in OpenNebula.""" """Delete host in OpenNebula."""
proc = subprocess.Popen(["/opt/occi.sh", "compute", "delete", if self.one_id and self.state != 'DONE':
"%d" % self.one_id], stdout=subprocess.PIPE) proc = subprocess.Popen(["/opt/occi.sh", "compute", "delete",
(out, err) = proc.communicate() "%d" % self.one_id], stdout=subprocess.PIPE)
(out, err) = proc.communicate()
self.firewall_host_delete() self.firewall_host_delete()
def firewall_host_delete(self): def firewall_host_delete(self):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment