remove unused variables/methods
This commit is contained in:
parent
921258749a
commit
c37effcbd7
8 changed files with 10 additions and 32 deletions
|
|
@ -2099,7 +2099,6 @@ class ClientSession(object):
|
|||
handler, headers, request = self._prepCall(name, args, kwargs)
|
||||
tries = 0
|
||||
self.retries = 0
|
||||
debug = self.opts.get('debug', False)
|
||||
max_retries = self.opts.get('max_retries', 30)
|
||||
interval = self.opts.get('retry_interval', 20)
|
||||
while True:
|
||||
|
|
@ -2279,7 +2278,7 @@ class ClientSession(object):
|
|||
|
||||
# check if server supports fast upload
|
||||
try:
|
||||
check = self._callMethod('checkUpload', (path, name))
|
||||
self._callMethod('checkUpload', (path, name))
|
||||
# fast upload was introduced in 1.7.1, earlier servers will not
|
||||
# recognise this call and return an error
|
||||
except GenericError:
|
||||
|
|
@ -2517,7 +2516,7 @@ def _taskLabel(taskInfo):
|
|||
extra = build_target['name']
|
||||
elif method == 'winbuild':
|
||||
if taskInfo.has_key('request'):
|
||||
vm = taskInfo['request'][0]
|
||||
#vm = taskInfo['request'][0]
|
||||
url = taskInfo['request'][1]
|
||||
target = taskInfo['request'][2]
|
||||
module_info = _module_info(url)
|
||||
|
|
@ -2607,7 +2606,7 @@ def fixEncoding(value, fallback='iso8859-15'):
|
|||
# decode it using the fallback encoding.
|
||||
try:
|
||||
return value.decode('utf8').encode('utf8')
|
||||
except UnicodeDecodeError, err:
|
||||
except UnicodeDecodeError:
|
||||
return value.decode(fallback).encode('utf8')
|
||||
|
||||
def add_file_logger(logger, fn):
|
||||
|
|
|
|||
|
|
@ -912,7 +912,7 @@ class TaskManager(object):
|
|||
return None
|
||||
|
||||
return procstats
|
||||
except IOError, e:
|
||||
except IOError:
|
||||
# process may have already gone away
|
||||
return None
|
||||
|
||||
|
|
@ -1103,7 +1103,6 @@ class TaskManager(object):
|
|||
self.logger.warn("Could not open")
|
||||
return False
|
||||
task_id = data['id']
|
||||
request = data['request']
|
||||
self.tasks[task_id] = data
|
||||
# set weight
|
||||
try:
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ class PlgHTTPSConnection(httplib.HTTPConnection):
|
|||
self.sock.connect(sa)
|
||||
if self.debuglevel > 0:
|
||||
print "connect: (%s, %s) [ssl]" % (self.host, self.port)
|
||||
except socket.error, msg:
|
||||
except socket.error:
|
||||
if self.debuglevel > 0:
|
||||
print 'connect fail:', (self.host, self.port)
|
||||
if self.sock:
|
||||
|
|
|
|||
|
|
@ -222,7 +222,7 @@ class BaseTaskHandler(object):
|
|||
failed = False
|
||||
for task in finished:
|
||||
try:
|
||||
result = self.session.getTaskResult(task)
|
||||
self.session.getTaskResult(task)
|
||||
except (koji.GenericError, xmlrpclib.Fault), task_error:
|
||||
self.logger.info("task %s failed or was canceled" % task)
|
||||
failed = True
|
||||
|
|
|
|||
|
|
@ -624,7 +624,7 @@ def parse_maven_chain(confs, scratch=False):
|
|||
for package, params in builds.items():
|
||||
depmap[package] = set(params.get('buildrequires', []))
|
||||
try:
|
||||
order = tsort(depmap)
|
||||
except ValueError, e:
|
||||
tsort(depmap)
|
||||
except ValueError:
|
||||
raise ValueError, 'No possible build order, missing/circular dependencies'
|
||||
return builds
|
||||
|
|
|
|||
|
|
@ -39,22 +39,6 @@ class TestDeleteBuild(unittest.TestCase):
|
|||
refs.return_value = retval
|
||||
assert kojihub.delete_build(build='', strict=False) is False
|
||||
|
||||
@mock.patch('kojihub.context')
|
||||
@mock.patch('kojihub.get_build')
|
||||
def test_delete_build_check_last_used_raise_error(self, build, context):
|
||||
context.session.assertPerm = mock.MagicMock()
|
||||
references = ['tags', 'rpms', 'archives', 'images', 'last_used']
|
||||
for ref in references:
|
||||
context = mock.MagicMock()
|
||||
context.session.return_value = context
|
||||
|
||||
with mock.patch('kojihub.build_references') as refs:
|
||||
retval = defaultdict(dict)
|
||||
if ref == 'last_used':
|
||||
retval[ref] = time.time()+100
|
||||
refs.return_value = retval
|
||||
with self.assertRaises(GenericError):
|
||||
kojihub.delete_build(build='', strict=True)
|
||||
|
||||
@mock.patch('kojihub.context')
|
||||
@mock.patch('kojihub.get_build')
|
||||
|
|
@ -70,4 +54,4 @@ class TestDeleteBuild(unittest.TestCase):
|
|||
if ref == 'last_used':
|
||||
retval[ref] = time.time()+100
|
||||
refs.return_value = retval
|
||||
assert kojihub.delete_build(build='', strict=False) is False
|
||||
self.assertFalse(kojihub.delete_build(build='', strict=False))
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ class TestGetBuildType(unittest.TestCase):
|
|||
@mock.patch('kojihub.get_build')
|
||||
@mock.patch('kojihub.QueryProcessor')
|
||||
def test_no_build(self, QueryProcessor, get_build):
|
||||
mocks = [QueryProcessor, get_build]
|
||||
get_build.return_value = None
|
||||
|
||||
# strict on
|
||||
|
|
@ -25,8 +24,6 @@ class TestGetBuildType(unittest.TestCase):
|
|||
@mock.patch('kojihub.QueryProcessor')
|
||||
def test_has_build(self, QueryProcessor, get_build, get_image_build,
|
||||
get_win_build, get_maven_build):
|
||||
mocks = [x for x in locals().values() if x is not self]
|
||||
|
||||
typeinfo = {'maven': {'maven': 'foo'},
|
||||
'win': {'win': 'foo'},
|
||||
'image': {'image': 'foo'},
|
||||
|
|
|
|||
|
|
@ -13,8 +13,7 @@ class TestNewTypedBuild(unittest.TestCase):
|
|||
|
||||
binfo = {'id': 1, 'foo': '137'}
|
||||
btype = 'sometype'
|
||||
btype_id = 99
|
||||
lookup_name.return_value = {'id':99, 'name':btype}
|
||||
lookup_name.return_value = {'id': 99, 'name': btype}
|
||||
|
||||
# no current entry
|
||||
query = QueryProcessor.return_value
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue