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
|
||||
cleanup = []
|
||||
for chain in vmchains:
|
||||
vm = session.xenapi.VM.get_by_name_label(chain)
|
||||
if len(vm) != 1:
|
||||
vm = session.xenapi.VM.get_by_name_label(chain + "-untagged")
|
||||
if len(vm) != 1:
|
||||
util.SMlog("chain " + chain + " does not correspond to a vm, cleaning up")
|
||||
cleanup.append(chain)
|
||||
continue
|
||||
if chain not in resident_vms:
|
||||
util.SMlog("vm " + chain + " is not running, cleaning up")
|
||||
vmname = chain
|
||||
if vmname not in resident_vms:
|
||||
vmname = chain + "-untagged"
|
||||
if vmname not in resident_vms:
|
||||
util.SMlog("vm " + chain + " is not running on this host, cleaning up")
|
||||
cleanup.append(chain)
|
||||
|
||||
for vm_name in cleanup:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user