Switch all uses of urllib and HTMLParser to import from six

As part of enabling python3 support in tempest we need to be able to
handle urllib, HTMLParser, and urllib2 usage in both python2 and
python3. Six provides a compat layer for doing this, so this commit
moves all uses of urllib2, HTMLParser, and urllib to get it through
six.

Change-Id: I81e348ac79001ac94bdb92a9b60c7dca4c93686a
diff --git a/tempest/scenario/test_dashboard_basic_ops.py b/tempest/scenario/test_dashboard_basic_ops.py
index 5aec01f..eb018eb 100644
--- a/tempest/scenario/test_dashboard_basic_ops.py
+++ b/tempest/scenario/test_dashboard_basic_ops.py
@@ -12,9 +12,9 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
-import HTMLParser
-import urllib
-import urllib2
+from six.moves import html_parser as HTMLParser
+from six.moves.urllib import parse
+from six.moves.urllib import request
 
 from tempest import config
 from tempest.scenario import manager
@@ -68,11 +68,11 @@
         super(TestDashboardBasicOps, cls).setup_credentials()
 
     def check_login_page(self):
-        response = urllib2.urlopen(CONF.dashboard.dashboard_url)
+        response = request.urlopen(CONF.dashboard.dashboard_url)
         self.assertIn("id_username", response.read())
 
     def user_login(self, username, password):
-        self.opener = urllib2.build_opener(urllib2.HTTPCookieProcessor())
+        self.opener = request.build_opener(request.HTTPCookieProcessor())
         response = self.opener.open(CONF.dashboard.dashboard_url).read()
 
         # Grab the CSRF token and default region
@@ -80,14 +80,14 @@
         parser.feed(response)
 
         # Prepare login form request
-        req = urllib2.Request(CONF.dashboard.login_url)
+        req = request.Request(CONF.dashboard.login_url)
         req.add_header('Content-type', 'application/x-www-form-urlencoded')
         req.add_header('Referer', CONF.dashboard.dashboard_url)
         params = {'username': username,
                   'password': password,
                   'region': parser.region,
                   'csrfmiddlewaretoken': parser.csrf_token}
-        self.opener.open(req, urllib.urlencode(params))
+        self.opener.open(req, parse.urlencode(params))
 
     def check_home_page(self):
         response = self.opener.open(CONF.dashboard.dashboard_url)