Fix SonarQube python:S1871.

This commit is contained in:
Andris Raugulis 2017-04-05 04:27:39 +03:00
parent 464bb154f3
commit 09c2e7b2d5

View File

@ -1192,11 +1192,9 @@ class SSH(object): # pylint: disable=too-few-public-methods
if ssh_prefix not in result:
result[ssh_prefix] = [None, None, None]
prev, push = result[ssh_prefix][i], False
if prev is None:
push = True
elif i == 0 and prev < ssh_version:
push = True
elif i > 0 and prev > ssh_version:
if ((prev is None) or
(prev < ssh_version and i == 0) or
(prev > ssh_version and i > 0)):
push = True
if push:
result[ssh_prefix][i] = ssh_version