Skip to content

Commit

Permalink
Fix LGTM issues
Browse files Browse the repository at this point in the history
Signed-off-by: Sangita Maity <sangitamaity0211@gmail.com>
  • Loading branch information
samaity committed May 13, 2020
1 parent 2072a5a commit 2646959
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions config/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,9 @@
import mlnx
import nat

from collections import OrderedDict
import ast


# import port config file path
from sfputil.main import get_platform_and_hwsku
from portconfig import get_port_config_file_name, parse_platform_json_file
from portconfig import get_port_config_file_name
from portconfig import get_child_ports

CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help', '-?'])
Expand Down Expand Up @@ -166,7 +162,7 @@ def shutdown_interfaces(ctx, del_intf_dict):
config_db = ctx.obj['config_db']
if get_interface_naming_mode() == "alias":
interface_name = interface_alias_to_name(intf)
if intf is None:
if interface_name is None:
click.echo("[ERROR] interface name is None!")
return False
if interface_name_is_valid(intf) is False:
Expand Down Expand Up @@ -2003,7 +1999,7 @@ def breakout(ctx, interface_name, mode, verbose, force_remove_dependencies, load

# Get current breakout mode
cur_brkout_dict = config_db.get_table('BREAKOUT_CFG')
cur_brkout_mode = cur_brkout_mode = cur_brkout_dict[interface_name]["brkout_mode"]
cur_brkout_mode = cur_brkout_dict[interface_name]["brkout_mode"]

# Validate Interface and Breakout mode
if not _validate_interface_mode(ctx, BREAKOUT_CFG_FILE, interface_name, mode, cur_brkout_mode):
Expand All @@ -2013,7 +2009,6 @@ def breakout(ctx, interface_name, mode, verbose, force_remove_dependencies, load
# Get list of interfaces to be deleted
del_ports = get_child_ports(interface_name, cur_brkout_mode, BREAKOUT_CFG_FILE)
del_intf_dict = {intf: del_ports[intf]["speed"] for intf in del_ports}
del_intf_dict = {intf: del_ports[intf]["speed"] for intf in del_ports}

if del_intf_dict:
""" shut down all the interface before deletion """
Expand Down

0 comments on commit 2646959

Please sign in to comment.