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."