CP-41972: update ACK to python3 and fixed some problems#201
CP-41972: update ACK to python3 and fixed some problems#201tianxiahcp merged 1 commit intoxenserver:masterfrom
Conversation
765bc61 to
b2355dd
Compare
|
Re-tested with xcp changes in: xenserver/python-libs#21 |
lindig
left a comment
There was a problem hiding this comment.
I'm not a Python expert but this looks good to me.
autocertkit/utils.py
Outdated
| log.debug("VM %s has these vif IPs %s" % (vm_ref, ifs)) | ||
|
|
||
| for _, f in ifs.items(): | ||
| for _, f in list(ifs.items()): |
autocertkit/utils.py
Outdated
| vm_ref, [[f[0], f[1], f[2].split('/')[0]] for _, f in list(ifs.items())]) | ||
| mif = get_context_vm_mif(vm_ref) | ||
| mdevices = [f[0] for _, f in ifs.items() if f[1] == mif[1]] | ||
| mdevices = [f[0] for _, f in list(ifs.items()) if f[1] == mif[1]] |
autocertkit/utils.py
Outdated
| host_ref = session.xenapi.VM.get_resident_on(vm_ref) | ||
| mip = get_context_vm_mip(vm_ref) | ||
| for id, vif_info in vifs_info.items(): | ||
| for id, vif_info in list(vifs_info.items()): |
autocertkit/utils.py
Outdated
| # get all MAC | ||
| all_mac = [] | ||
| for _, iface in ifs.items(): | ||
| for _, iface in list(ifs.items()): |
autocertkit/utils.py
Outdated
| """Return the xml attributes of a node as a dictionary object""" | ||
| attr = {} | ||
| for k, v in node._get_attributes().items(): | ||
| for k, v in list(node._get_attributes().items()): |
plugins/autocertkit
Outdated
| stdout.decode().strip(), "stderr": str(stderr).strip()} | ||
| else: | ||
| res = {"returncode": process.returncode, "stdout": | ||
| str(stdout).strip(), "stderr": str(stderr).strip()} |
There was a problem hiding this comment.
I am not sure if it could return None actually, while the code you should simplify:
{"returncode": process.returncode, "stdout": <Move if else here.>, "stderr": str(stderr).strip()}
|
I suggested you to investigate whether |
|
Signed-off-by: alexhimmel <alex.ac@qq.com>
15c958e to
a7e279c
Compare
|
For Popen(), if python version > 3.7 can use |
All test passed
XenRT Job ID: 3717307, 3717308, 3717309, 3717310, 3717311