Change in vdsm[master]: pep8ize vdsm_api

zhshzhou at linux.vnet.ibm.com zhshzhou at linux.vnet.ibm.com
Sun Sep 16 08:46:16 UTC 2012


Zhou Zheng Sheng has posted comments on this change.

Change subject: pep8ize vdsm_api
......................................................................


Patch Set 1: Fails; I would prefer that you didn't submit this

(2 inline comments)

Found 4 changes in vdsmapi.py. They are changing
 expr_eval.has_key('enum')
and
 expr_eval.has_key('union')

to
 'enum' in expr_eval
and 
 'union' in expr_eval

So they are acceptable.

However when running autobuild.sh, it says
/usr/bin/pep8 .... vdsm_api ...
Traceback (most recent call last):
  File "/usr/bin/pep8", line 9, in <module>
    load_entry_point('pep8==1.0.1', 'console_scripts', 'pep8')()
  File "/usr/lib/python2.7/site-packages/pep8.py", line 1348, in _main
    runner(path)
  File "/usr/lib/python2.7/site-packages/pep8.py", line 1023, in input_file
    errors = Checker(filename).check_all()
  File "/usr/lib/python2.7/site-packages/pep8.py", line 823, in __init__
    self.lines = readlines(filename)
  File "/usr/lib/python2.7/site-packages/pep8.py", line 726, in readlines
    return open(filename).readlines()
IOError: [Errno 2] No such file or directory: 'vdsm_api'
make[3]: *** [check-local] Error 1
make[3]: Leaving directory `/root/rpmbuild/BUILD/vdsm-4.10.0'

Then I checked, there is no vdsm_api directory in /root/rpmbuild/BUILD/vdsm-4.10.0 indeed. vdsm_api is not in the SUBDIRS list in top-level Makefile.am. It's not installed and there is no Makefile.am in vdsm_api. Maybe before this patch, we have to fix that problem firstly?

....................................................
File vdsm_api/process-schema.py
Line 207:         Produce a table listing attributes with type links and the description
Line 208:         """
Line 209:         f.write('<table class="attrlist">\n')
Line 210:         f.write('<caption>%s</caption>\n' % caption)
Line 211:         if not names:
This backslash is redundant.
Line 212:             f.write('<tr><td class="attrlist">None</td>' \
Line 213:                          '<td class="attrlist"></td></tr>\n')
Line 214:         for name, dataType, desc in zip(names, types, details):
Line 215:             f.write('<tr>')


....................................................
File vdsm_api/vdsmapi.py
Line 195:     elif type(name) == list:
Line 196:         return '%s *' % c_list_type(name[0])
Line 197:     elif is_enum(name):
Line 198:         return name
Line 199:     elif name == None or len(name) == 0:
Maybe we could use "name is None" instead, because None is a singleton.
http://www.python.org/dev/peps/pep-0008/#programming-recommendations
Line 200:         return 'void'
Line 201:     elif name == name.upper():
Line 202:         return '%sEvent *' % camel_case(name)
Line 203:     else:


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I38418b2251ab67ad96325a2a474e1d03eddeabba
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Adam Litke <agl at us.ibm.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegurap at redhat.com>
Gerrit-Reviewer: Zhou Zheng Sheng <zhshzhou at linux.vnet.ibm.com>


More information about the vdsm-patches mailing list