Skip to content

Commit ce1e591

Browse files
committed
pylint-0.14 fixes
Signed-off-by: Dinesh Dutt <[email protected]>
1 parent 164c76d commit ce1e591

File tree

6 files changed

+17
-16
lines changed

6 files changed

+17
-16
lines changed

suzieq/cli/nubia_patch.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
Command = namedtuple("Command", "name help aliases exclusive_arguments")
1919

2020
FunctionInspection = namedtuple(
21-
"FunctionInspection", "arguments " "command subcommands"
21+
"FunctionInspection", "arguments command subcommands"
2222
)
2323
_ArgDecoratorSpec = namedtuple(
2424
"_ArgDecoratorSpec", "arg name aliases description positional choices"
@@ -87,7 +87,7 @@ def decorator(function):
8787
# reject positional=True if we are applied over a class
8888
if isclass(function) and positional:
8989
raise ValueError(
90-
"Cannot set positional arguments for super " "commands"
90+
"Cannot set positional arguments for super commands"
9191
)
9292

9393
# We use __annotations__ to allow the usage of python 3 typing

suzieq/engines/pandas/path.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -741,7 +741,7 @@ def get(self, **kwargs) -> pd.DataFrame:
741741

742742
if not self.ctxt.engine:
743743
raise AttributeError(
744-
"Specify an analysis engine using set engine " "command"
744+
"Specify an analysis engine using 'set engine' command"
745745
)
746746

747747
namespaces = kwargs.get("namespace", self.ctxt.namespace)

suzieq/poller/worker/services/bgp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def _clean_eos_data(self, processed_data, raw_data):
8888
new_entry['pfxBestRx'] = entry['pfxBestRx'][i]
8989

9090
new_entry['defOriginate'] = False
91-
if 'safi' == 'evpn':
91+
if entry['safi'][i] == 'evpn':
9292
if ('Sending extended community not configured' in
9393
entry.get('errorMsg', '')):
9494
new_entry['communityTypes'] = []

suzieq/poller/worker/services/service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -790,7 +790,7 @@ async def run(self):
790790
for x in ostatus])
791791
status = ostatus[0]
792792
if (status in [0, 200]):
793-
rxBytes = len(output.__str__())
793+
rxBytes = len(str(output))
794794

795795
# We don't expect the output from two different hostnames
796796
nodename = output[0]["hostname"]

suzieq/restServer/query.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# pylint: disable=unused-argument,missing-function-docstring
2+
# pylint: disable=redefined-outer-name, unused-variable
3+
# pylint: disable=redefined-builtin, missing-class-docstring,
14
import argparse
25
import inspect
36
import logging
@@ -40,6 +43,8 @@ def check_config_file():
4043

4144
def app_init(cfg_file):
4245
'''This is the actual API initilaizer'''
46+
# pylint: disable=global-variable-not-assigned
47+
4348
global app
4449

4550
app.cfg_file = cfg_file
@@ -161,7 +166,7 @@ def rest_main(*args) -> None:
161166
_ = cfg['rest']['API_KEY']
162167
except KeyError:
163168
print('missing API_KEY in config file')
164-
exit(1)
169+
sys.exit(1)
165170

166171
logcfg, loglevel = get_log_config_level(cfg)
167172

@@ -180,14 +185,6 @@ def rest_main(*args) -> None:
180185
ssl_certfile=ssl_certfile)
181186

182187

183-
"""
184-
each of these read functions behaves the same, it gets the arguments
185-
puts them into dicts and passes them to sqobjects
186-
187-
assume that all API functions are named read_*
188-
"""
189-
190-
191188
class CommonVerbs(str, Enum):
192189
show = "show"
193190
summarize = "summarize"
@@ -894,7 +891,7 @@ def get_svc(command):
894891

895892

896893
def run_command_verb(command, verb, command_args, verb_args,
897-
columns=['default'], format=None):
894+
columns=None, format=None):
898895
"""
899896
Runs the command and verb with the command_args and verb_args
900897
@@ -904,6 +901,10 @@ def run_command_verb(command, verb, command_args, verb_args,
904901
422 -- FastAPI validation errors
905902
500 -- Exceptions
906903
"""
904+
905+
if columns is None:
906+
columns = ['default']
907+
907908
svc = get_svc(command)
908909
try:
909910
svc_inst = svc(**command_args,

suzieq/shared/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,7 @@ def init_logger(logname: str,
712712
sh = logging.StreamHandler(sys.stdout)
713713

714714
formatter = logging.Formatter(
715-
"%(asctime)s - %(name)s - %(levelname)s " "- %(message)s"
715+
"%(asctime)s - %(name)s - %(levelname)s - %(message)s"
716716
)
717717
if fh:
718718
fh.setFormatter(formatter)

0 commit comments

Comments
 (0)