MCPcopy Create free account
hub / github.com/apache/cloudstack / check_domid_changed

Function check_domid_changed

scripts/vm/network/security_group.py:787–804  ·  view source on GitHub ↗
(vmName)

Source from the content-addressed store, hash-verified

785
786
787def check_domid_changed(vmName):
788 curr_domid = get_vm_id(vmName)
789 if (curr_domid is None) or (not curr_domid.isdigit()):
790 curr_domid = '-1'
791
792 vm_name = vmName
793 logfilename = logpath + vm_name + ".log"
794 if not os.path.exists(logfilename):
795 return ['-1', curr_domid]
796
797 lines = (line.rstrip() for line in open(logfilename))
798
799 [_vmName,_vmID,_vmIP,old_domid,_signature,_seqno] = ['_', '-1', '_', '-1', '_', '-1']
800 for line in lines:
801 [_vmName,_vmID,_vmIP,old_domid,_signature,_seqno] = line.split(',')
802 break
803
804 return [curr_domid, old_domid]
805
806
807def network_rules_for_rebooted_vm(vmName):

Callers 1

Calls 2

get_vm_idFunction · 0.85
existsMethod · 0.65

Tested by

no test coverage detected