mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
CS-15921 : in 2.1 timeframe, -untagged string is appended to the end of instance name,
in cleanup_rules function, we need to convert chain name to vm name correclty
This commit is contained in:
parent
625ecc306b
commit
5d5d69cd51
@ -1087,15 +1087,11 @@ def cleanup_rules(session, args):
|
|||||||
cleaned = 0
|
cleaned = 0
|
||||||
cleanup = []
|
cleanup = []
|
||||||
for chain in vmchains:
|
for chain in vmchains:
|
||||||
vm = session.xenapi.VM.get_by_name_label(chain)
|
vmname = chain
|
||||||
if len(vm) != 1:
|
if vmname not in resident_vms:
|
||||||
vm = session.xenapi.VM.get_by_name_label(chain + "-untagged")
|
vmname = chain + "-untagged"
|
||||||
if len(vm) != 1:
|
if vmname not in resident_vms:
|
||||||
util.SMlog("chain " + chain + " does not correspond to a vm, cleaning up")
|
util.SMlog("vm " + chain + " is not running on this host, cleaning up")
|
||||||
cleanup.append(chain)
|
|
||||||
continue
|
|
||||||
if chain not in resident_vms:
|
|
||||||
util.SMlog("vm " + chain + " is not running, cleaning up")
|
|
||||||
cleanup.append(chain)
|
cleanup.append(chain)
|
||||||
|
|
||||||
for vm_name in cleanup:
|
for vm_name in cleanup:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user