Commit 168c514d authored by Florian Schaal's avatar Florian Schaal

when changing the ip_address for a vm set the old ip to "unused"

parent 93177377
......@@ -94,7 +94,10 @@ class vm_openvz_plugin {
}
// Set the IP address
if(isset($this->dataRecord['ip_address'])) $app->db->query("UPDATE openvz_ip SET vm_id = ? WHERE ip_address = ?", $this->id, $this->dataRecord['ip_address']);
if(isset($this->dataRecord['ip_address'])) {
$app->db->query("UPDATE openvz_ip SET vm_id = 0 WHERE vm_id = ?", $this->id);
$app->db->query("UPDATE openvz_ip SET vm_id = ? WHERE ip_address = ?", $this->id, $this->dataRecord['ip_address']);
}
// Create the OpenVZ config file and store it in config field
$this->makeOpenVZConfig();
......
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 to comment