Change in vdsm[master]: PEP8 cleanup for *.py under vdsm_hooks

zhshzhou at linux.vnet.ibm.com zhshzhou at linux.vnet.ibm.com
Wed Dec 5 09:28:17 UTC 2012


Zhou Zheng Sheng has posted comments on this change.

Change subject: PEP8 cleanup for *.py under vdsm_hooks
......................................................................


Patch Set 1: Verified

(1 inline comment)

Pass autobuild.sh.

pydiff find some changes.

First change:

 pydiff vdsm_hooks/qos/before_vm_start.py                      ../diffs/vdsm_hooks/qos/before_vm_start.py
 1 difference(s)
 first file: vdsm_hooks/qos/before_vm_start.py
 second file: ../diffs/vdsm_hooks/qos/before_vm_start.py
 
((31,
  "\nQoS Hook\n========\nlibvirt domain xml:\n<interface>\n    ...\n    <bandwidth>\n        <inbound average='1' peak='2' burst='5'/>\n        <outbound average='0.5'/>\n    </bandwidth>\n    ...\n</interface>\n\nNote:\n    for average, peak, and burst explanation look at:\n    # man tc tbf\n\n'average' attribute is mandatory,\ninbound or outbound elements can be once but not mandatory\n\nsyntax:\n    00:11:22:33:44:55=in{'average':'1','peek':'2','burst':'5'}^out{'average':'1'}&11:11:11:11:11:11=...\n"),
 (32,
  "\nQoS Hook\n========\nlibvirt domain xml:\n<interface>\n    ...\n    <bandwidth>\n        <inbound average='1' peak='2' burst='5'/>\n        <outbound average='0.5'/>\n    </bandwidth>\n    ...\n</interface>\n\nNote:\n    for average, peak, and burst explanation look at:\n    # man tc tbf\n\n'average' attribute is mandatory,\ninbound or outbound elements can be once but not mandatory\n\nsyntax:\n    MAC1=in{'average':'1','peek':'2','burst':'5'}^out{'average':'1'}&MAC2=...\n    Please replace 'MACn' with the MAC address of the virtual nic to be edited.\n"))

This change shortens the mac address 00:11:22:33:44:55 and 11:11:11:11:11:11 to MAC1 and MAC2 to fit in 80 columns in one line. I think it's OK.


The second change:

 pydiff vdsm_hooks/sriov/after_vm_destroy.py                   ../diffs/vdsm_hooks/sriov/after_vm_destroy.py
 1 difference(s)
 first file: vdsm_hooks/sriov/after_vm_destroy.py
 second file: ../diffs/vdsm_hooks/sriov/after_vm_destroy.py
 
 ((18, '!='), (19, 'is not'))

This is for using 'is' and 'is not' when compare to "None", it's OK.

....................................................
File vdsm_hooks/directlun/after_vm_destroy.py
Line 43: 
Line 44:         hooking.write_domxml(domxml)
Line 45:     except:
Line 46:         sys.stderr.write('directlun after_vm_destroy: [unexpected error]: %s\n'
Line 47:                          % traceback.format_exc())
I think it might be better if written as

        sys.stderr.write(
            'directlun after_vm_destroy: [unexpected error]: %s\n' %
            traceback.format_exc())


--
To view, visit http://gerrit.ovirt.org/9734
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ifc798bb4598291d52e2cebce1ed65228f657ebbd
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Mark Wu <wudxw at linux.vnet.ibm.com>
Gerrit-Reviewer: Mark Wu <wudxw at linux.vnet.ibm.com>
Gerrit-Reviewer: Zhou Zheng Sheng <zhshzhou at linux.vnet.ibm.com>


More information about the vdsm-patches mailing list