Merge branch '2.2.y' of ssh://git.cloud.com/var/lib/git/cloudstack-oss into 2.2.y

This commit is contained in:
David Nalley 2011-08-31 16:22:00 -04:00
commit b0c68179c4
1 changed files with 5 additions and 3 deletions

View File

@ -884,9 +884,11 @@ def cleanup_rules(session, args):
if 1 in [ chain.startswith(c) for c in ['r-', 'i-', 's-', 'v-', 'l-'] ]:
vm = session.xenapi.VM.get_by_name_label(chain)
if len(vm) != 1:
util.SMlog("chain " + chain + " does not correspond to a vm, cleaning up")
cleanup.append(chain)
continue
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
vm_rec = session.xenapi.VM.get_record(vm[0])
state = vm_rec.get('power_state')
if state != 'Running' and state != 'Paused':