Start Gating on Pyflakes and Hacking

Instead of globally ignoring Pyflakes and Hacking
warnings, only blacklist those that occur frequently
and fix the others. Start gating on those checks.

Change-Id: Ice032c16d445ef08ef018bcdc5c221ab3c323755
python3: Drop mox dependency

Drop mox dependency, it is not being used at all.

Change-Id: Ibcc971cee46dabad9c612d95593640ac139638e3
Signed-off-by: Chuck Short <chuck.short@canonical.com>
Remove explicit depend on distribute.

Change-Id: I1e9f561babf205de0c4afd2546c862b96d694f58
python3: compatibility for iteritems and iterkeys

Use six to allow python2/pyton3 for iteritems and
iterkeys.

six.iteriems() replaces dictionary.iteritems() (python2)
and dictionary.iterms() (python3)

six.iterkeys() replaces dictionary.iterkeys (python2)
and dictionary.keys() (python3)

Change-Id: I26c80b78a7dedf3aa32eedf01a83ff6d1e592ba7
Signed-off-by: Chuck Short <chuck.short@canonical.com>
Merge "Start Gating on Pyflakes and Hacking"
Merge "python3: Drop mox dependency"
python3: Basic python3 compatibility.

Basic python3 compatibilty.

Change-Id: I4388f5956cf397f8e33d20085aae6c6a728dbbda
Signed-off-by: Chuck Short <chuck.short@canonical.com>
python3: fix imports compatibility

Python3 reorganized the standard library and moved several functions
to different modules. Six provides a consistent interface
to them through the fake six.moves module.

However, the urlparse, urllib2, etc modules have been combined
into one module which Six does not support so do it the old
fashioned way.

Change-Id: Ieb7cc7ee2a4a97807873cfe2fc3fa0a5cf3c3980
Signed-off-by: Chuck Short <chuck.short@canonical.com>
Merge "python3: Basic python3 compatibility."
python3: Update for metaclasses

Use six.with_metaclass to create a new class with
a base class base and metaclass metaclass.

Change-Id: Id1e70f8cae0ac3dd075157f57d41a02b15e655f4
Signed-off-by: Chuck Short <chuck.short@canonical.com>
python3: Fix unicode strings

Python3 enforces the distinction between byte
strings and text strings more rigorously than
python2. So use six.text_type where approiate.

Change-Id: I46b3f5fe1f990fc1b7a3ee32904d608b070fc4c3
Signed-off-by: Chuck Short <chuck.short@canonical.com>
Merge "python3: Fix unicode strings"
Merge "Remove explicit depend on distribute."
python3: Fix import compatibility.

Python3 reorganized the standard library and moved several functions
to different modules. Six provides a consistent interface
to them through the fake six.moves module.

However, the urlparse, urllib2, etc modules have been combined
into one module which Six does not support so do it the old
fashioned way.

Change-Id: Idfb4f8eb538dcc98a1f7befc4487635d7f483973
Signed-off-by: Chuck Short <chuck.short@canonical.com>
python3: Fix traceback while running tests.

Fix:

TypeError: Unicode-objects must be encoded before hashing

while running tests. This is due to the fact in python3 hashlib.md5
works with bytes and we are passing unicode strings.

Change-Id: I0adde942423af28572473030f6685e12cd8f7dae
Signed-off-by: Chuck Short <chuck.short@canonical.com>
Merge "python3: Fix traceback while running tests."