Skip to content

Commit

Permalink
Clean up LGTM alerts (#1239)
Browse files Browse the repository at this point in the history
Clean up some alerts which were detected by LGTM tool
  • Loading branch information
jleveque committed Nov 16, 2020
1 parent f46c27e commit 1c45ca1
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 20 deletions.
1 change: 0 additions & 1 deletion pcieutil/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

import click
from sonic_py_common import device_info, logger
from tabulate import tabulate
except ImportError as e:
raise ImportError("%s - required module not found" % str(e))

Expand Down
1 change: 0 additions & 1 deletion scripts/db_migrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import argparse
import json
import os
import sys
import traceback

Expand Down
6 changes: 3 additions & 3 deletions scripts/natconfig
Original file line number Diff line number Diff line change
Expand Up @@ -287,15 +287,15 @@ class NatConfig(object):
else:
print("Admin Mode : disabled")
if 'nat_timeout' in global_data:
print("Global Timeout : {}".format(global_data['nat_timeout'], "secs"))
print("Global Timeout : {} secs".format(global_data['nat_timeout']))
else:
print("Global Timeout : 600 secs")
if 'nat_tcp_timeout' in global_data:
print("TCP Timeout : {}".format(global_data['nat_tcp_timeout'], "secs"))
print("TCP Timeout : {} secs".format(global_data['nat_tcp_timeout']))
else:
print("TCP Timeout : 86400 secs")
if 'nat_udp_timeout' in global_data:
print("UDP Timeout : {}".format(global_data['nat_udp_timeout'], "secs"))
print("UDP Timeout : {} secs".format(global_data['nat_udp_timeout']))
else:
print("UDP Timeout : 300 secs")
print("")
Expand Down
6 changes: 0 additions & 6 deletions scripts/natshow
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,6 @@ class NatShow(object):
continue

ip_protocol = "all"
source = "---"
destination = "---"
translated_dst = "---"
translated_src = "---"

Expand Down Expand Up @@ -282,8 +280,6 @@ class NatShow(object):
nat_twice_values = self.appl_db.get_all(self.appl_db.APPL_DB,'NAT_TWICE_TABLE:{}'.format(nat_twice_entry))

ip_protocol = "all"
source = "---"
destination = "---"

source = nat_twice_keys[0]
destination = nat_twice_keys[1]
Expand All @@ -308,8 +304,6 @@ class NatShow(object):
napt_twice_values = self.appl_db.get_all(self.appl_db.APPL_DB,'NAPT_TWICE_TABLE:{}'.format(napt_twice_entry))

ip_protocol = napt_twice_keys[0].lower()
source = "---"
destination = "---"

source = napt_twice_keys[1] + ':' + napt_twice_keys[2]
destination = napt_twice_keys[3] + ':' + napt_twice_keys[4]
Expand Down
4 changes: 1 addition & 3 deletions show/bgp_frr_v4.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import json

import click

import utilities_common.bgp_util as bgp_util
import utilities_common.cli as clicommon
import utilities_common.constants as constants
import utilities_common.multi_asic as multi_asic_util

from show.main import ip, run_command

###############################################################################
Expand Down
6 changes: 1 addition & 5 deletions show/interfaces/portchannel.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@

import os
import sys

import click
import utilities_common.cli as clicommon
from natsort import natsorted
Expand Down Expand Up @@ -167,4 +163,4 @@ def portchannel(namespace, display, verbose):
"""Show PortChannel information"""
team = Teamshow(namespace, display)
team.get_teams_info()
team.display_summary()
team.display_summary()
1 change: 0 additions & 1 deletion utilities_common/bgp_util.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import ipaddress
import json
import os
import re

import click
Expand Down

0 comments on commit 1c45ca1

Please sign in to comment.