[openstack-dev] [Cinder][DRBD] questions about pep8/flake8 etc.

Philipp Marek philipp.marek at linbit.com
Mon Dec 21 14:40:17 UTC 2015

Hi everybody,

in the current patch https://review.openstack.org/#/c/259973/1 the test 
script needs to use a lot of the constant definitions of the backend driver 
it's using (DRBDmanage).

As the DRBDmanage libraries need not be installed on the CI nodes, I'm 
providing a minimum of upstream files, accumulated in a separate directory 
- they get imported and "fixed" to the expected location, so that the 
driver that should be tested runs as if DRBDmanage is installed.

My problem is now that the upstream project doesn't accept all the pep8 
conventions like Openstack does; so the CI run 
gives a lot of messages like "E221 multiple spaces before operator" and 
similar. (It even crashes during AST parsing ;)

So, I can see these options now:

  * Make pep8 ignore these files - they're only used by one test script,
    and are never used in production anyway.
    + Simple
    + New upstream files can simply be dropped in as needed
    - bad example?
  * Reformat the files to conform to pep8
    - some work for every new version that needs to be incorporated
    - can't be compared for equality with upstream any more
    - might result in mismatches later on, ie. production code uses
      different values from test code

  * Throw upstream files away, and do "manual" fakes
    - A lot of work
    - Work needed for every new needed constant
    - lots of duplicated code
    - might result in mismatches later on, ie. production code uses
      different values from test code
    + whole checkout still "clean" for pep8

  * Require DRBDmanage to be installed
    + uses same values as upstream and production
    - Need to get it upstream into PyPi
    - Meaning delay
    - delay for every new release of DRBDmanage
    - Might not even be compatible with every used distribution/CI
      out there

I would prefer the first option - make pep8 ignore these files.
But I'm only a small player here, what's the opinion of the Cinder cores?
Would that be acceptable?



More information about the OpenStack-dev mailing list