Irit Goihman has uploaded a new change for review.

Change subject: py3 tests: ported imagetickets_test.py to python3
......................................................................

py3 tests: ported imagetickets_test.py to python3

ported relevant code to python3 in order that imagetickets_test.py
will be python3 compatible.

Change-Id: If13fb30966d98fa0381da25f0f2907899df12e96
Signed-off-by: Irit Goihman <[email protected]>
---
M tests/Makefile.am
M tests/imagetickets_test.py
M vdsm/storage/imagetickets.py
3 files changed, 6 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/59/59859/1

diff --git a/tests/Makefile.am b/tests/Makefile.am
index 352f5be..16119bd 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -179,7 +179,6 @@
        hooksTests.py \
        hostdevTests.py \
        hoststatsTests.py \
-       imagetickets_test.py \
        iscsiTests.py \
        lvmTests.py \
        main.py \
diff --git a/tests/imagetickets_test.py b/tests/imagetickets_test.py
index 39a2800..f2ea111 100644
--- a/tests/imagetickets_test.py
+++ b/tests/imagetickets_test.py
@@ -18,15 +18,17 @@
 # Refer to the README and COPYING files for full details of the license
 #
 
-import httplib
 import json
 import socket
 import io
+
+from six.moves import http_client
 
 from monkeypatch import MonkeyPatch
 from testlib import VdsmTestCase
 from testlib import expandPermutations, permutations
 from testlib import recorded
+
 
 from vdsm.storage import exception as se
 from storage import imagetickets
@@ -158,7 +160,7 @@
             self.assertTrue(err_msg in e.value)
 
     @MonkeyPatch(imagetickets, 'uhttp', FakeUHTTP())
-    @permutations([[httplib.HTTPException], [socket.error], [OSError]])
+    @permutations([[http_client.HTTPException], [socket.error], [OSError]])
     def test_image_tickets_error(self, exc_type):
         ticket = create_ticket(uuid="uuid")
 
diff --git a/vdsm/storage/imagetickets.py b/vdsm/storage/imagetickets.py
index 281a0e9..476f249 100644
--- a/vdsm/storage/imagetickets.py
+++ b/vdsm/storage/imagetickets.py
@@ -19,12 +19,12 @@
 #
 
 import functools
-import httplib
 import json
 import logging
 import os
 
 from contextlib import closing
+from six.moves import http_client
 
 try:
     from ovirt_imageio_daemon import uhttp
@@ -74,7 +74,7 @@
         try:
             con.request(method, "/tickets/%s" % uuid, body=body)
             res = con.getresponse()
-        except (httplib.HTTPException, EnvironmentError) as e:
+        except (http_client.HTTPException, EnvironmentError) as e:
             raise se.ImageTicketsError("Error communicating with "
                                        "ovirt-imageio-daemon: "
                                        "{error}".format(error=e))


-- 
To view, visit https://gerrit.ovirt.org/59859
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If13fb30966d98fa0381da25f0f2907899df12e96
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Irit Goihman <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/admin/lists/[email protected]

Reply via email to