
1) Module urllib2 is missed in Python 3, so it should be replaced by other http lib. "requests" is good library for such stuff, which supports both Python 2.* and Python 3.* 2) Function 'rally.common.utils.parse_docstring' uses built-in function 'filter'. This function returns different types in Python 2.* and Python 3.*. Since results are used as a list, 'filter' should be replaced by list comprehension. 3) Extend H330 hacking rule to chech 'dict.iterkeys()', 'dict.itervalues()' and 'dict.iterlist()'. Also, fixed all places, which are failed in terms of this rule. 4) Function object does not have 'func_code' attribute in Python 3, but '__code__' attribute exist in both Python 2 and Python 3 Also, 3 tests are broken due to new release(1.6.0) of oslo.config, so we need to skip them to unblock our gates until new version of oslo.config will be released with appropriate fix. Closes-Bug: #1405919 Change-Id: Icc42e220ac3f15ae6c838a4698b3c9578177513c
Rally Style Commandments
- Step 1: Read the OpenStack Style Commandments http://docs.openstack.org/developer/hacking/
- Step 2: Read on
Rally Specific Commandments
- * [N30x] - Reserved for rules related to
mock
library -
- [N301] - Ensure that
assert_*
methods frommock
library is used correctly - [N302] - Ensure that nonexistent "assert_called" is not used
- [N303] - Ensure that nonexistent "assert_called_once" is not used
- [N301] - Ensure that
- * [N310-N314] - Reserved for rules related to logging
-
- [N310] - Ensure that
rally.log
is used instead ofrally.openstack.common.log
- [N311] - Validate that debug level logs are not translated
- [N312] - Validate correctness of debug on check.
- [N310] - Ensure that
- * [N32x] - Reserved for rules related to assert* methods
-
- [N320] - Ensure that
assertTrue(isinstance(A, B))
is not used - [N321] - Ensure that
assertEqual(type(A), B)
is not used - [N322] - Ensure that
assertEqual(A, None)
andassertEqual(None, A)
are not used - [N323] - Ensure that
assertTrue/assertFalse(A in/not in B)
are not used with collection contents - [N324] - Ensure that
assertEqual(A in/not in B, True/False)
andassertEqual(True/False, A in/not in B)
are not used with collection contents
- [N320] - Ensure that
- * [N33x] - Reserved for rules related to Python 3 compatibility
-
- [N330] - Ensure that
dict.iterkeys()
,dict.itervalues()
,dict.iteritems()
anddict.iterlist()
are not used - [N331] - Ensure that
basestring
is not used - [N332] - Ensure that
StringIO.StringIO
is not used - [N333] - Ensure that
urlparse
is not used - [N334] - Ensure that
itertools.imap
is not used - [N335] - Ensure that
xrange
is not used - [N336] - Ensure that
string.lowercase
andstring.uppercase
are not used - [N337] - Ensure that
next()
method on iterator objects is not used
- [N330] - Ensure that
- [N340] - Ensure that we are importing always
from rally import objects