99import subprocess
1010import json
1111import pkg_resources
12- import urlparse
13- from copy import copy , deepcopy
12+ from copy import deepcopy
1413from bkr .inttest import Process
1514from bkr .inttest .labcontroller import LabControllerTestCase
1615from bkr .server .model import OSMajor
1716from turbogears .database import session
1817
18+ from six .moves import urllib
19+
20+
1921_current_dir = os .path .dirname (__file__ )
2022_compose_test_dir = pkg_resources .resource_filename ('bkr.inttest.labcontroller' , 'compose_layout' )
2123_git_root_dir = os .path .join (_current_dir , '..' , '..' , '..' , '..' , '..' )
@@ -1175,7 +1177,7 @@ def setUp(self):
11751177 u"type" : u"initrd"
11761178 }
11771179 ],
1178- u"kernel_options" : u" inst.stage2={}" .format (urlparse .urljoin (
1180+ u"kernel_options" : u" inst.stage2={}" .format (urllib . parse .urljoin (
11791181 self .distro_url , u'RHVH4/RHVH-4.3-20200323.0/compose/RHVH/x86_64/os' )),
11801182 u"kernel_options_post" : None ,
11811183 u"ks_meta" : u" autopart_type=thinp liveimg=Packages/redhat-virtualization-host-image-update-1.0.0-1.noarch.rpm ks_keyword=inst.ks" ,
@@ -1199,7 +1201,7 @@ def setUp(self):
11991201 ],
12001202 u"tree_build_time" : u"1584961599" ,
12011203 u"urls" : [
1202- u"{}" .format (urlparse .urljoin (self .distro_url , u'RHVH4/RHVH-4.3-20200323.0/compose/RHVH/x86_64/os/' ))
1204+ u"{}" .format (urllib . parse .urljoin (self .distro_url , u'RHVH4/RHVH-4.3-20200323.0/compose/RHVH/x86_64/os/' ))
12031205 ],
12041206 u"variant" : u"RHVH"
12051207 }
@@ -1208,7 +1210,7 @@ def _run_import(self, import_args):
12081210 p = subprocess .Popen (import_args ,
12091211 stdout = subprocess .PIPE ,
12101212 stderr = subprocess .PIPE ,
1211- env = dict (os .environ .items () + [('PYTHONUNBUFFERED' , '1' )]))
1213+ env = dict (list ( os .environ .items () ) + [('PYTHONUNBUFFERED' , '1' )]))
12121214 stdout , stderr = p .communicate ()
12131215 if p .returncode :
12141216 raise TreeImportError (import_args , p .returncode , stderr )
@@ -1220,7 +1222,7 @@ def dry_run_import_trees(self, additional_import_args):
12201222 trees , stderr = self ._run_import (
12211223 ['python' , _command , '--debug' , '--json' , '--dry-run' ]
12221224 + additional_import_args )
1223- print stderr
1225+ print ( stderr )
12241226 # check logging is working correctly
12251227 self .assertIn ('Dry Run only' , stderr )
12261228 self .assertIn ('Attempting to import: ' , stderr )
@@ -1559,6 +1561,6 @@ def test_rhel8_partner_import(self):
15591561 self .assertItemsEqual (trees , [self .x86_64_rhel8_partner ])
15601562
15611563 def test_rhvh43_import (self ):
1562- trees = self .dry_run_import_trees (['{}' .format (urlparse .urljoin (self .distro_url ,
1564+ trees = self .dry_run_import_trees (['{}' .format (urllib . parse .urljoin (self .distro_url ,
15631565 'RHVH4/RHVH-4.3-20200323.0/compose' ))])
15641566 self .assertItemsEqual (trees , [self .x86_64_rhvh43 ])
0 commit comments