mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-03 04:12:31 +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
9214fa0af6
commit
b58123e075
@ -1087,16 +1087,12 @@ 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)
|
cleanup.append(chain)
|
||||||
continue
|
|
||||||
if chain not in resident_vms:
|
|
||||||
util.SMlog("vm " + chain + " is not running, cleaning up")
|
|
||||||
cleanup.append(chain)
|
|
||||||
|
|
||||||
for vm_name in cleanup:
|
for vm_name in cleanup:
|
||||||
destroy_network_rules_for_vm(session, {'vmName':vm_name})
|
destroy_network_rules_for_vm(session, {'vmName':vm_name})
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user