+def create_diskpool(server, virt='KVM'):
+ dpool_list = diskpool_list(server, virt='KVM')
+ if len(dpool_list) > 0:
+ dpoolname=dpool_list[0]
+ else:
+ global dpoolname
Don't use a global here. Globals should be avoided, especially in this
case where this function is modifying a value that is used by multiple
test cases.
Instead, have this function return the name of the diskpool it uses.
+ diskxml = PoolXML(server, virt=virt)
+ ret = diskxml.create_vpool()
+ if not ret:
+ logger.error('Failed to create the disk pool "%s"',
+ dpoolname)
+ return FAIL
+ logger.info("Disk Pool on machine is: %s ", dpoolname)
+ return PASS
--
Kaitlin Rupert
IBM Linux Technology Center
kaitlin(a)linux.vnet.ibm.com