Commit 2856f939 by Őry Máté

one: more secure one_delete

parent aca6c74c
...@@ -559,6 +559,7 @@ class Instance(models.Model): ...@@ -559,6 +559,7 @@ class Instance(models.Model):
def one_delete(self): def one_delete(self):
"""Delete host in OpenNebula.""" """Delete host in OpenNebula."""
if self.one_id and self.state != 'DONE':
proc = subprocess.Popen(["/opt/occi.sh", "compute", "delete", proc = subprocess.Popen(["/opt/occi.sh", "compute", "delete",
"%d" % self.one_id], stdout=subprocess.PIPE) "%d" % self.one_id], stdout=subprocess.PIPE)
(out, err) = proc.communicate() (out, err) = proc.communicate()
......
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