Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use /var/tmp instead of /tmp for sonic_installer and generate_dump #985

Open
wants to merge 49 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
3909818
Use /var/tmp instead of /tmp for sonic_installer and generate_dump
olivier-singla Jul 11, 2020
b4b5fd3
Support to verify reboot for secure boot (#979)
xumia Jul 13, 2020
da27247
Fix the None Type Exception when Interface Table does not exist (col…
abdosi Jul 13, 2020
a23479e
[sonic-installer] Hyphens instead of underscores in command and subco…
jleveque Jul 14, 2020
527860d
[show] Add support for QSFP-DD cables on 'show' command (#989)
shlomibitton Jul 16, 2020
e3d6ba0
[acl_loader] Fix bugs in acl_loader (#991)
daall Jul 16, 2020
82dfe50
[sonic-installer] Update group name for 'verify-next-image' subcomman…
jleveque Jul 19, 2020
995cf39
[config] Restart telemetry service upon config (re)load (#992)
jleveque Jul 21, 2020
aa1b072
[config] Add Initial draft of Breakout Mode subcommand (#766)
samaity Jul 23, 2020
ef9ac2a
importing json needed for DPB CLI (#1010)
samaity Jul 30, 2020
c6c5be1
[show] Fix for 'trunk' PortChannel reported as 'routed' port (#1002)
shlomibitton Jul 30, 2020
c0c3cce
[config/config_mgmt.py]: Fix typo and enable test for tablesWithOutYa…
Jul 30, 2020
216688e
[tests]: rename sonic-utilitie-tests to tests (#1022)
lguohan Aug 3, 2020
dfaae69
[lldpshow]: Fix input device is not a TTY error (#1016)
ArunSaravananBalachandran Aug 3, 2020
c9d3550
[tests]: fix drops_group_test failure on second run (#1023)
lguohan Aug 3, 2020
9700e45
[show/config]: combine feature and container feature cli (#1015)
lguohan Aug 3, 2020
5d26391
[tests]: move feature_test.py into tests folder (#1027)
lguohan Aug 4, 2020
092ebd2
[config load]: do not stop/reset/reload service if it is disabled (#1…
lguohan Aug 5, 2020
d1cf75f
[sonic-installer] Create Envvars File for Incoming Image (#1011)
tahmed-dev Aug 5, 2020
8e64106
Add secure fast/warm-reboot support for Aboot (#994)
Staphylo Aug 5, 2020
f9d3ee0
[tests] Add unit tests for 'show platform ...' commands (#1021)
jleveque Aug 5, 2020
e17383a
[PDDF] Make utilities compatible to platform API 2.0, in accordance w…
FuzailBrcm Aug 6, 2020
ed3d7cb
[cli]: pass db connector as click context (#1029)
lguohan Aug 7, 2020
a80826d
[config qos] QoS and Buffer config genration for multi ASIC platforms…
smaheshm Aug 8, 2020
621aad0
[Python] Migrate applications/scripts to import sonic-py-common packa…
jleveque Aug 8, 2020
e722cb0
[cli/feature]: split feature command into a separate file (#1034)
lguohan Aug 8, 2020
fec442e
[tests]:add coverage for config/main/utilities_common module (#1039)
lguohan Aug 9, 2020
33ba594
enable watchdog before running platform specific reboot plugin (#1037)
sujinmkang Aug 9, 2020
fa7fb3a
[pytest/coverage]: add coverage for all scripts (#1041)
lguohan Aug 9, 2020
0225c09
[config/show]: split vlan into separate file (#1038)
lguohan Aug 10, 2020
7ae8024
Update all references to new 'sonic-installer' file name (#1033)
jleveque Aug 11, 2020
fdda5ac
Python 3 compliance (#1043)
jleveque Aug 11, 2020
0e96c99
[show]: split show interfaces commands into separate file (#1044)
lguohan Aug 12, 2020
91986b7
[watermarkstat] Import print_function from __future__ (#1048)
jleveque Aug 12, 2020
84b2c5b
[teamshow]: refactor teamshow to use state db information (#1049)
lguohan Aug 12, 2020
2d9d00d
[config] Eliminate port breakout-related globals (#1045)
jleveque Aug 12, 2020
e741c7c
[PFCWD] Fix issue with "pfcwd show stats" command during SONiC init (…
volodymyrsamotiy Aug 12, 2020
027553c
[show/vlan]: fix show vlan config (#1050)
lguohan Aug 13, 2020
d5fdd74
[db_migrator] Support migrating database regarding buffer configurati…
stephenxs Aug 13, 2020
a15b6bf
Common functions for show CLI support on multi ASIC (#999)
arlakshm Aug 14, 2020
37f131e
Change fast-reboot script to use swss and radv service script (#1036)
vaibhavhd Aug 14, 2020
3297b7a
[sflow_test.py]: Fix show sflow display. (#1054)
Aug 15, 2020
8768580
[filter-fdb] Call Filter FDB Main From Within Test Code (#1051)
tahmed-dev Aug 15, 2020
5263b54
[config] Reduce Calls to SONiC Cfggen (#1052)
tahmed-dev Aug 19, 2020
56a97a6
[fast-reboot]: Fix fail to execute fast-reboot problem (#1047)
kuanyu99 Aug 21, 2020
17fb378
[sonic-installer] Import re module (#1061)
jleveque Aug 21, 2020
2c0ff92
support show interface commands for multi ASIC platforms (#1006)
arlakshm Aug 21, 2020
d198e6c
Use /var/tmp instead of /tmp for sonic_installer and generate_dump
olivier-singla Jul 11, 2020
d5ef3ba
Merge branch 'var_tmp' of https://github.com/olivier-singla/sonic-uti…
olivier-singla Aug 22, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ If this is a bug fix, make sure your description includes "closes #xxxx",
issue when the PR is merged.

If you are adding/modifying/removing any command or utility script, please also
make sure to add/modify/remove any unit tests from the sonic-utilities-tests
make sure to add/modify/remove any unit tests from the tests
directory as appropriate.

If you are modifying or removing an existing 'show', 'config' or 'sonic-clear'
Expand Down
17 changes: 9 additions & 8 deletions acl_loader/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,13 @@
import ipaddr
import json
import syslog
import tabulate
from natsort import natsorted
import sonic_device_util

import openconfig_acl
import tabulate
import pyangbind.lib.pybindJSON as pybindJSON
from swsssdk import ConfigDBConnector
from swsssdk import SonicV2Connector
from swsssdk import SonicDBConfig
from natsort import natsorted
from sonic_py_common import device_info
from swsssdk import ConfigDBConnector, SonicV2Connector, SonicDBConfig


def info(msg):
Expand Down Expand Up @@ -142,7 +140,7 @@ def __init__(self):

# Getting all front asic namespace and correspding config and state DB connector

namespaces = sonic_device_util.get_all_namespaces()
namespaces = device_info.get_all_namespaces()
for front_asic_namespaces in namespaces['front_ns']:
self.per_npu_configdb[front_asic_namespaces] = ConfigDBConnector(use_unix_socket_path=True, namespace=front_asic_namespaces)
self.per_npu_configdb[front_asic_namespaces].connect()
Expand Down Expand Up @@ -244,6 +242,9 @@ def set_table_name(self, table_name):
:param table_name: Table name
:return:
"""
if not self.is_table_valid(table_name):
warning("Table \"%s\" not found" % table_name)

self.current_table = table_name

def set_session_name(self, session_name):
Expand Down Expand Up @@ -412,7 +413,7 @@ def convert_l2(self, table_name, rule_idx, rule):
def convert_ip(self, table_name, rule_idx, rule):
rule_props = {}

if rule.ip.config.protocol:
if rule.ip.config.protocol or rule.ip.config.protocol == 0: # 0 is a valid protocol number
if self.ip_protocol_map.has_key(rule.ip.config.protocol):
rule_props["IP_PROTOCOL"] = self.ip_protocol_map[rule.ip.config.protocol]
else:
Expand Down
27 changes: 8 additions & 19 deletions config/aaa.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,9 @@
# -*- coding: utf-8 -*-

import click
import netaddr
from swsssdk import ConfigDBConnector


def is_ipaddress(val):
if not val:
return False
try:
netaddr.IPAddress(str(val))
except ValueError:
return False
return True

from swsssdk import ConfigDBConnector
import utilities_common.cli as clicommon

def add_table_kv(table, entry, key, val):
config_db = ConfigDBConnector()
Expand All @@ -31,7 +21,6 @@ def del_table_key(table, entry, key):
del data[key]
config_db.set_entry(table, entry, data)


@click.group()
def aaa():
"""AAA command line"""
Expand Down Expand Up @@ -81,7 +70,7 @@ def fallback(option):
def login(auth_protocol):
"""Switch login authentication [ {tacacs+, local} | default ]"""
if len(auth_protocol) is 0:
print 'Not support empty argument'
click.echo('Argument "auth_protocol" is required')
return

if 'default' in auth_protocol:
Expand Down Expand Up @@ -118,7 +107,7 @@ def timeout(ctx, second):
elif second:
add_table_kv('TACPLUS', 'global', 'timeout', second)
else:
click.echo('Not support empty argument')
click.echo('Argument "second" is required')
tacacs.add_command(timeout)
default.add_command(timeout)

Expand All @@ -133,7 +122,7 @@ def authtype(ctx, type):
elif type:
add_table_kv('TACPLUS', 'global', 'auth_type', type)
else:
click.echo('Not support empty argument')
click.echo('Argument "type" is required')
tacacs.add_command(authtype)
default.add_command(authtype)

Expand All @@ -148,7 +137,7 @@ def passkey(ctx, secret):
elif secret:
add_table_kv('TACPLUS', 'global', 'passkey', secret)
else:
click.echo('Not support empty argument')
click.echo('Argument "secret" is required')
tacacs.add_command(passkey)
default.add_command(passkey)

Expand All @@ -164,7 +153,7 @@ def passkey(ctx, secret):
@click.option('-m', '--use-mgmt-vrf', help="Management vrf, default is no vrf", is_flag=True)
def add(address, timeout, key, auth_type, port, pri, use_mgmt_vrf):
"""Specify a TACACS+ server"""
if not is_ipaddress(address):
if not clicommon.is_ipaddress(address):
click.echo('Invalid ip address')
return

Expand Down Expand Up @@ -196,7 +185,7 @@ def add(address, timeout, key, auth_type, port, pri, use_mgmt_vrf):
@click.argument('address', metavar='<ip_address>')
def delete(address):
"""Delete a TACACS+ server"""
if not is_ipaddress(address):
if not clicommon.is_ipaddress(address):
click.echo('Invalid ip address')
return

Expand Down
2 changes: 1 addition & 1 deletion config/config_mgmt.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def __init__(self, source="configDB", debug=False, allowTablesWithoutYang=True):
def __del__(self):
pass

def tablesWithoutYang(self):
def tablesWithOutYang(self):
'''
Return tables loaded in config for which YANG model does not exist.

Expand Down
48 changes: 48 additions & 0 deletions config/feature.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import click

from utilities_common.cli import AbbreviationGroup, pass_db

#
# 'feature' group ('config feature ...')
#
@click.group(cls=AbbreviationGroup, name='feature', invoke_without_command=False)
def feature():
"""Configure features"""
pass

#
# 'state' command ('config feature state ...')
#
@feature.command('state', short_help="Enable/disable a feature")
@click.argument('name', metavar='<feature-name>', required=True)
@click.argument('state', metavar='<state>', required=True, type=click.Choice(["enabled", "disabled"]))
@pass_db
def feature_state(db, name, state):
"""Enable/disable a feature"""
state_data = db.cfgdb.get_entry('FEATURE', name)

if not state_data:
click.echo("Feature '{}' doesn't exist".format(name))
sys.exit(1)

db.cfgdb.mod_entry('FEATURE', name, {'state': state})

#
# 'autorestart' command ('config feature autorestart ...')
#
@feature.command(name='autorestart', short_help="Enable/disable autosrestart of a feature")
@click.argument('name', metavar='<feature-name>', required=True)
@click.argument('autorestart', metavar='<autorestart>', required=True, type=click.Choice(["enabled", "disabled"]))
@pass_db
def feature_autorestart(db, name, autorestart):
"""Enable/disable autorestart of a feature"""
feature_table = db.cfgdb.get_table('FEATURE')
if not feature_table:
click.echo("Unable to retrieve feature table from Config DB.")
sys.exit(1)

if not feature_table.has_key(name):
click.echo("Unable to retrieve feature '{}'".format(name))
sys.exit(1)

db.cfgdb.mod_entry('FEATURE', name, {'auto_restart': autorestart})
Loading