Skip to content

Commit

Permalink
making flake8 happy
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitry Lyssenko committed Feb 13, 2023
1 parent ca0023c commit d34349a
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 13 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ pyflakes:
pyflakes pyeapi/ test/

flake8:
flake8 --ignore=E201,E202,E302,E303,E402,E731,W391 --exit-zero pyeapi/
flake8 --ignore=E201,E202,E302,E303,E402,E731,W391,N802 --max-line-length=100 test/
flake8 --ignore=E128,E201,E202,E302,E303,E402,E731,W391 --exit-zero pyeapi/
flake8 --ignore=E128,E201,E202,E302,E303,E402,E731,W391,N802 --max-line-length=100 test/

check:
check-manifest
Expand Down
7 changes: 4 additions & 3 deletions pyeapi/api/ipinterfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ def get( self, name ):
* name (str): The name of the interface
* address (str): The IP address of the interface in the form
of A.B.C.D/E (None if no ip configured)
* secondary (list): The list of secondary IP addresses of the interface
(if any configured)
* secondary (list): The list of secondary IP addresses of the
interface (if any configured)
* mtu (int): The configured value for IP MTU.
Expand Down Expand Up @@ -101,7 +101,8 @@ def _parse_address( self, config ):
dict: A dict object intended to be merged into the resource dict
"""
match = re.findall( r'ip address ([^\s]+)', config, re.M )
primary, secondary = ( match[0], match[1:] ) if match else ( None, None )
primary, secondary = ( match[0],
match[1:] ) if match else ( None, None )
return dict( address=primary,
secondary=secondary ) if secondary else dict( address=primary )

Expand Down
3 changes: 2 additions & 1 deletion pyeapi/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@

from pyeapi.eapilib import HttpEapiConnection, HttpsEapiConnection
from pyeapi.eapilib import HttpsEapiCertConnection
from pyeapi.eapilib import HttpEapiSessionConnection, HttpsEapiSessionConnection
from pyeapi.eapilib import HttpEapiSessionConnection
from pyeapi.eapilib import HttpsEapiSessionConnection
from pyeapi.eapilib import SocketEapiConnection, HttpLocalEapiConnection
from pyeapi.eapilib import CommandError

Expand Down
2 changes: 1 addition & 1 deletion pyeapi/eapilib.py
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,7 @@ def authentication(self, username, password):
_LOGGER.exception(exc)
self.socket_error = exc
self.error = exc
error_msg = 'Socket error during eAPI authentication: %s' % str(exc)
error_msg = f'Socket error during eAPI authentication: {exc}'
raise ConnectionError(str(self), error_msg)
except ValueError as exc:
_LOGGER.exception(exc)
Expand Down
8 changes: 2 additions & 6 deletions pyeapi/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,6 @@ def make_iterable(value):
Returns:
An iterable object of type list
"""
if sys.version_info <= (3, 0):
# Convert unicode values to strings for Python 2
if isinstance(value, unicode):
value = str(value)
if isinstance(value, str) or isinstance(
value, dict) or isinstance(value, CliVariants):
value = [value]
Expand Down Expand Up @@ -259,5 +255,5 @@ class CliVariants:
"""
def __init__(self, *cli):
assert len( cli ) >= 2, 'must be initialized with 2 or more arguments'
self.variants = [ v if not isinstance(v, str) and isinstance(v, Iterable)
else [v] for v in cli ]
self.variants = [ v if not isinstance(v,
str) and isinstance(v, Iterable) else [v] for v in cli ]

0 comments on commit d34349a

Please sign in to comment.