Giter Site home page Giter Site logo

sonic-utilities's Introduction

static analysis:

Total alerts Language grade: Python

sonic-utilities builds:

master build

202205 build

202012 build

SONiC: Software for Open Networking in the Cloud

sonic-utilities

Command-line utilities for SONiC

This repository produces two packages, as follows:

sonic-utilities

A Python wheel package, containing all the Python source code for the command-line utilities

Setting up a build/test environment

The sonic-utilities package depends on a number of other packages, many of which are available via PyPI, but some are part of the SONiC codebase. When building/testing the package, setuptools/pip will attempt to install the packages available from PyPI. However, you will need to manually build and install the SONiC dependencies before attempting to build or test the package.

Currently, this list of dependencies is as follows:

  • libyang_1.0.73_amd64.deb
  • libyang-cpp_1.0.73_amd64.deb
  • python3-yang_1.0.73_amd64.deb
  • redis_dump_load-1.1-py3-none-any.whl
  • sonic_py_common-1.0-py3-none-any.whl
  • sonic_config_engine-1.0-py3-none-any.whl
  • sonic_yang_mgmt-1.0-py3-none-any.whl
  • sonic_yang_models-1.0-py3-none-any.whl
  • python-swsscommon_1.0.0_amd64.deb

A convenient alternative is to let the SONiC build system configure a build enviroment for you. This can be done by cloning the sonic-buildimage repo, building the sonic-utilities package inside the Debian Buster slave container, and staying inside the container once the build finishes. During the build process, the SONiC build system will build and install all the necessary dependencies inside the container. After following the instructions to clone and initialize the sonic-buildimage repo, this can be done as follows:

  1. Configure the build environment for an ASIC type (any type will do, here we use generic)

    make configure PLATFORM=generic
    
  2. Build the sonic-utilities Python wheel package inside the Bullseye slave container, and tell the build system to keep the container alive when finished

    make NOSTRETCH=1 NOBUSTER=1 KEEP_SLAVE_ON=yes target/python-wheels/bullseye/sonic_utilities-1.2-py3-none-any.whl
    
  3. When the build finishes, your prompt will change to indicate you are inside the slave container. Change into the src/sonic-utilities/ directory

    user@911799f161a0:/sonic$ cd src/sonic-utilities/
    
  4. You can now make changes to the sonic-utilities source and build the package or run unit tests with the commands below. When finished, you can exit the container by calling exit.

To build

python3 setup.py bdist_wheel

To run unit tests

python3 setup.py test

sonic-utilities-data

A Debian package, containing data files needed by the utilities (bash_completion files, Jinja2 templates, etc.)

To build

Instructions for building the sonic-utilities-data package can be found in sonic-utilities-data/README.md


Contribution guide

Please read the contributor guide for more details on how to contribute.

All contributors must sign an Individual Contributor License Agreement (ICLA) before contributions can be accepted. This process is now automated via a GitHub bot when submitting new pull request. If the contributor has not yet signed a CLA, the bot will create a comment on the pull request containing a link to electronically sign the CLA.

GitHub Workflow

We're following basic GitHub Flow. If you have no idea what we're talking about, check out GitHub's official guide. Note that merge is only performed by the repository maintainer.

Guide for performing commits:

  • Isolate each commit to one component/bugfix/issue/feature
  • Use a standard commit message format:
[component/folder touched]: Description intent of your changes

[List of changes]

Signed-off-by: Your Name [email protected]

For example:

swss-common: Stabilize the ConsumerTable

* Fixing autoreconf
* Fixing unit-tests by adding checkers and initialize the DB before start
* Adding the ability to select from multiple channels
* Health-Monitor - The idea of the patch is that if something went wrong with the notification channel,
  we will have the option to know about it (Query the LLEN table length).

  Signed-off-by: John Doe [email protected]
  • Each developer should fork this repository and add the team as a Contributor
  • Push your changes to your private fork and do "pull-request" to this repository
  • Use a pull request to do code review
  • Use issues to keep track of what is going on

sonic-utilities's People

Contributors

arlakshm avatar bingwang-ms avatar blueve avatar daall avatar dgsudharsan avatar ghooo avatar isabelmsft avatar jleveque avatar junchao-mellanox avatar keboliu avatar lguohan avatar maipbui avatar nazariig avatar neethajohn avatar pavel-shirshov avatar prsunny avatar qiluo-msft avatar renukamanavalan avatar sihuihan88 avatar stepanblyschak avatar stephenxs avatar taoyl-ms avatar tsvanduyn avatar vadymhlushko-mlnx avatar vaibhavhd avatar vdahiya12 avatar vivekrnv avatar wen587 avatar wendani avatar yxieca avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sonic-utilities's Issues

interface_stat: not found

root@str-s6100-acs-2:/home/admin# show interfaces status
Command: interface_stat
/bin/sh: 1: interface_stat: not found

[acl-loader]fail if swss is not fully ready

Description

when doing 'config load_minigraph', if syncd or orchagent are not in a correct state, load minigraph action fail. (acl-loader step)

Steps to reproduce the issue

  1. reload the SONiC
  2. do config load_minigraph within 2 minutes
    show ip bgp and interfaces are good, but some other resources are not

Describe the results you received

Describe the results you expected

Additional information you deem important (e.g. issue happens only occasionally)

Output of show version

(paste your output here)

portstat shows negative counter for RX_OK

:~$ sudo portstat
Last cached time was 2017-10-11 19:00:26.387868
      Iface    ADMIN    OPER        RX_OK       RX_BPS    RX_UTIL    RX_ERR    RX_DRP    RX_OVR       TX_OK        TX_BPS    TX_UTIL    TX_ERR       TX_DRP    TX_OVR
-----------  -------  ------  -----------  -----------  ---------  --------  --------  --------  ----------  ------------  ---------  --------  -----------  --------
Ethernet116       up      up     -584,110  9725.13 B/s      0.00%         0   586,217         0  72,208,263  4624.59 KB/s      0.09%         0  377,228,521         0

Sfputil.py failed to get eeprom data without a cable

I got error when I tired to display a port's eeprom which don't plugging any SFP+/QSFP+ cable.
Is it normally?

admin@sonic:~ $ sudo sfputil show eeprom -p Ethernet0
Traceback (most recent call last):
File "/usr/bin/sfputil", line 9, in
load_entry_point('sonic-utilities==1.1', 'console_scripts', 'sfputil')()
File "/usr/lib/python2.7/dist-packages/click/core.py", line 716, in call
return self.main(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/click/core.py", line 696, in main
rv = self.invoke(ctx)
File "/usr/lib/python2.7/dist-packages/click/core.py", line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/lib/python2.7/dist-packages/click/core.py", line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/lib/python2.7/dist-packages/click/core.py", line 889, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/lib/python2.7/dist-packages/click/core.py", line 534, in invoke
return callback(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/sfputil/main.py", line 430, in eeprom
output += port_eeprom_data_string_pretty(logical_port_name, dump_dom)
File "/usr/lib/python2.7/dist-packages/sfputil/main.py", line 195, in port_eeprom_data_string_pretty
result += dict_to_string_pretty(iface_data_dict, 1)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xff in position 933: ordinal not in range(128)
admin@sonic:~ $ cat /sys/bus/i2c/devices/11-0050/eeprom | hexdump -C
00000000 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
*
00000100
admin@sonic:~$ sudo sfputil version
sfputil version 2.0

[teamshow]: Does not display proper output if run by regular user

If teamshow is run by a regular user (i.e., not admin or root), the "Protocol" column only displays "N/A" for all portchannels, and the "Ports" column is empty.

However, if run as admin or root, the output is correct.

UPDATE: This is caused by the fact that /usr/bin/teamdctl on the base image tries to run teamdctl inside the teamd docker, but regular users do not have permissions to run docker exec.

sonic_installer not cleaning up old aboot images by default

When we do a sonic_installer on aboot image, the old images are not cleaned up by default. This is resulting in "no space left on device" error.

Currently there is an option to clean-up the images by explicitly giving the "sonic_installer cleanup" command but suggest to make this default behavior when use installs a new image

Failed to locate platform-specific led_control module

May  1 02:20:11.470924 str-s6100-acs-5 INFO ledd: Failed to locate platform-specific led_control module.
May  1 02:20:11.477458 str-s6100-acs-5 INFO pmon.sh[19040]: 2018-05-01 02:20:11,477 INFO success: ledd entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
May  1 02:20:11.478009 str-s6100-acs-5 INFO pmon.sh[19040]: 2018-05-01 02:20:11,477 INFO exited: ledd (exit status 1; not expected)
May  1 02:20:12.482331 str-s6100-acs-5 INFO pmon.sh[19040]: 2018-05-01 02:20:12,481 INFO spawned: 'ledd' with pid 1063
May  1 02:20:12.534330 str-s6100-acs-5 INFO ledd: Starting up...
May  1 02:20:13.280567 str-s6100-acs-5 INFO ledd: Failed to locate platform-specific led_control module.
May  1 02:20:13.287187 str-s6100-acs-5 INFO pmon.sh[19040]: 2018-05-01 02:20:13,286 INFO success: ledd entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
May  1 02:20:13.287753 str-s6100-acs-5 INFO pmon.sh[19040]: 2018-05-01 02:20:13,286 INFO exited: ledd (exit status 1; not expected)
May  1 02:20:14.291135 str-s6100-acs-5 INFO pmon.sh[19040]: 2018-05-01 02:20:14,290 INFO spawned: 'ledd' with pid 1070
May  1 02:20:14.341849 str-s6100-acs-5 INFO ledd: Starting up...

handle notimplementederror exception for the plugins

in sfputil, gracefully catch notimplementederror exception throw by plugins and print out error instead of throw traceback stack.

admin@str-msn2700-20:/usr/share/sonic/device/x86_64-mlnx_msn2700-r0/plugins$ sudo sfputil show lpmode
Traceback (most recent call last):
  File "/usr/bin/sfputil", line 9, in <module>
    load_entry_point('sonic-utilities==1.1', 'console_scripts', 'sfputil')()
  File "/usr/lib/python2.7/dist-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python2.7/dist-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python2.7/dist-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python2.7/dist-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python2.7/dist-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/sfputil/main.py", line 514, in lpmode
    lpmode = platform_sfputil.get_low_power_mode(physical_port)
  File "/usr/share/sonic/device/x86_64-mlnx_msn2700-r0/plugins/sfputil.py", line 54, in get_low_power_mode
    raise NotImplementedError
NotImplementedError

[fast-reboot] I2C failure after executed fast-reboot

Description

Sometime I2C topology will failure after executed "fast-reboot".

It cause by fast-reboot won't trigger release procedure (e.q: /ert/rc1~6.d/K*) like normal reboot, and boot into new kernel directly.

Usually, switch vendor will implement some control or monitor mechanism to handle their deivce via I2C, and it will generate I2C traffic periodically
It will make a situation about someone is using I2C during fast-reboot, then new kernel will initial I2C topology fail or some device under busy state.

Therefore, suggest to modify /usr/bin/fast-reboot to add either one as below:
(1) Trigger /ert/rc1~6.d/K* before reboot step of fast-reboot.

OR

(2) Trigger switch vendor's release procedure (/etc/init.d/platform-module-xxxxx stop) before reboot step of fast-reboot.
=> Usually, platform-module-xxxxx response for start/stop I2C topology / I2C relate driver.


Steps to reproduce the issue

In order to look pure behavior of SoNIC fast-reboot.
This reproduce procedure exclude switch vendor's module firstly.

  1. Exclude switch vendor's initial script
    => Comment out context of "start" part of /etc/init.d/platform-module-xxxxx, or remove the script.
    [Ex]
    root@SONiC-Inventec-d7054:~# cat /etc/init.d/platform-modules-d7054q28b
    ...
    start)
    echo -n "Setting up board... "
    depmod -a
    # /usr/local/bin/inventec_d7054_util.py -f install <<<<<<< comment out here!
    echo "done."
    ;;
    ...

  2. reboot system to ensure no switch vendor's module
    [Ex]
    root@SONiC-Inventec-d7054:# reboot

  3. Probe I2C modules and setup I2C topology manually.
    [Ex]
    root@SONiC-Inventec-d7054:# modprobe i2c-mux
    root@SONiC-Inventec-d7054:# modprobe i2c-mux-pca954x
    root@SONiC-Inventec-d7054:# modprobe i2c-dev
    root@SONiC-Inventec-d7054:# echo pca9548 0x71 > /sys/bus/i2c/devices/i2c-0/new_device

  4. Check I2C can be access
    [Ex]
    root@SONiC-Inventec-d7054:# ls /sys/bus/i2c/devices/
    0-0071 i2c-0 i2c-1 i2c-2 i2c-3 i2c-4 i2c-5 i2c-6 i2c-7 i2c-8
    root@SONiC-Inventec-d7054:#
    root@SONiC-Inventec-d7054:# i2cget -y 3 0x20 0
    0xff
    root@SONiC-Inventec-d7054:# i2cget -y 6 0x20 0
    0xff

  5. Prepare a I2C stress script
    [Ex]
    root@SONiC-Inventec-d7054:# cat stress_i2c.sh
    #!/bin/bash
    while [ 1 ]
    do
    i2cget -y 3 0x20 0 > /dev/null
    i2cget -y 6 0x20 0 > /dev/null
    done

  6. Execute stress script in background
    [Ex]
    root@SONiC-Inventec-d7054:# sh stress_i2c.sh &
    [1] 2430
    root@SONiC-Inventec-d7054:# sh stress_i2c.sh &
    [2] 2699
    root@SONiC-Inventec-d7054:# sh stress_i2c.sh &
    [3] 3614
    root@SONiC-Inventec-d7054:# sh stress_i2c.sh &
    [4] 4400
    root@SONiC-Inventec-d7054:# sh stress_i2c.sh &
    [5] 5323
    root@SONiC-Inventec-d7054:#

  7. Execute fast-reboot
    [Ex]
    root@SONiC-Inventec-d7054:# fast-reboot

  8. After fast-reboot, probe I2C modules and setup I2C topology manually.
    => The same with step-3

  9. Get issues
    [Ex]
    root@SONiC-Inventec-d7054:# i2cget -y 3 0x20 0
    [ 125.419639] i801_smbus 0000:00:1f.3: SMBus is busy, can't use it!
    Error: Read failed
    root@SONiC-Inventec-d7054:# i2cget -y 6 0x20 0
    [ 131.274139] i801_smbus 0000:00:1f.3: SMBus is busy, can't use it!
    Error: Read failed
    root@SONiC-Inventec-d7054:#

Note:

  1. We can find error msg like SMBus is busy.
  2. Please try it again if issues not happen.
    => Issues happen condition: someone is using I2C during fast-reboot

Describe the results you received

I2C can't be accessed after execute fast-reboot

root@SONiC-Inventec-d7054:# i2cget -y 3 0x20 0
[ 125.419639] i801_smbus 0000:00:1f.3: SMBus is busy, can't use it!
Error: Read failed
root@SONiC-Inventec-d7054:# i2cget -y 6 0x20 0
[ 131.274139] i801_smbus 0000:00:1f.3: SMBus is busy, can't use it!
Error: Read failed
root@SONiC-Inventec-d7054:#


Describe the results you expected

I2C should be accessible

root@SONiC-Inventec-d7054:# i2cget -y 3 0x20 0
0xff
root@SONiC-Inventec-d7054:# i2cget -y 6 0x20 0
0xff


Additional information you deem important (e.g. issue happens only occasionally)

(1) Usually, this issues issue happens occasionally.
That because of the issues condition is "someone is using I2C during fast-reboot"

(2) This issues will be solved If you are invoke "/etc/init.d/platform-module-xxxxx stop" before final step (execute reboot) of fast-reboot. or invoke /etc/rc6.d/Kxxxx is ok too.


Output of show version

root@SONiC-Inventec-d7054:~# show version
SONiC Software Version: SONiC.HEAD.603-a917517
Distribution: Debian 8.10
Kernel: 3.16.0-5-amd64
Build commit: a917517
Build date: Sun May 27 07:05:24 UTC 2018
Built by: johnar@jenkins-worker-4

Docker images:
REPOSITORY TAG IMAGE ID SIZE
docker-syncd-brcm HEAD.603-a917517 6ea2d437d2af 331.8 MB
docker-syncd-brcm latest 6ea2d437d2af 331.8 MB
docker-orchagent-brcm HEAD.603-a917517 bf49606a6932 252.6 MB
docker-orchagent-brcm latest bf49606a6932 252.6 MB
docker-lldp-sv2 HEAD.603-a917517 b1e74bb1fae3 265.8 MB
docker-lldp-sv2 latest b1e74bb1fae3 265.8 MB
docker-dhcp-relay HEAD.603-a917517 084ac6122760 249.1 MB
docker-dhcp-relay latest 084ac6122760 249.1 MB
docker-database HEAD.603-a917517 1891a9d3a27d 247.8 MB
docker-database latest 1891a9d3a27d 247.8 MB
docker-teamd HEAD.603-a917517 2f5e9cfa61cb 252.3 MB
docker-teamd latest 2f5e9cfa61cb 252.3 MB
docker-snmp-sv2 HEAD.603-a917517 9f02dc564068 286.7 MB
docker-snmp-sv2 latest 9f02dc564068 286.7 MB
docker-router-advertiser HEAD.603-a917517 ea28efd33902 245.4 MB
docker-router-advertiser latest ea28efd33902 245.4 MB
docker-platform-monitor HEAD.603-a917517 b02bc911d236 276.7 MB
docker-platform-monitor latest b02bc911d236 276.7 MB
docker-fpm-quagga HEAD.603-a917517 f543a3f6da39 259.1 MB
docker-fpm-quagga latest f543a3f6da39 259.1 MB

root@SONiC-Inventec-d7054:~#

PS:
This log was dump after execute the reproduce procedure.
Due to it comment out the switch vendor's initial script.
Therefore some service maybe not normally.
sonic_dump_SONiC-Inventec-d7054_20180613_131514.tar.gz

config interface shutdown/startup command could get ip address lost

Description

Steps to reproduce the issue
admin@sonic:~$ sudo ifconfig Ethernet116
Ethernet116 Link encap:Ethernet HWaddr 00:e0:ec:3c:0a:3e
inet addr:10.0.1.20 Bcast:255.255.255.255 Mask:255.255.255.254
inet6 addr: 2002::1/64 Scope:Global
UP BROADCAST MULTICAST MTU:9100 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

admin@sonic:$ sudo config interface shutdown Ethernet116
admin@sonic:
$ sudo ifconfig Ethernet116
Ethernet116 Link encap:Ethernet HWaddr 00:e0:ec:3c:0a:3e
inet addr:10.0.1.20 Bcast:255.255.255.255 Mask:255.255.255.254
BROADCAST MULTICAST MTU:9100 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

admin@sonic:$ sudo config interface startup Ethernet116
admin@sonic:
$ sudo ifconfig Ethernet116
Ethernet116 Link encap:Ethernet HWaddr 00:e0:ec:3c:0a:3e
inet addr:10.0.1.20 Bcast:255.255.255.255 Mask:255.255.255.254
UP BROADCAST MULTICAST MTU:9100 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

Describe the results you received
ipv6 address is lost

Describe the results you expected
ipv6 address should be reserved.

Additional information you deem important (e.g. issue happens only occasionally)
cat /etc/network/interfaces | grep -A 5 Ethernet116
allow-hotplug Ethernet116
iface Ethernet116 inet static
mtu 9100
address 10.0.1.20
netmask 255.255.255.254

allow-hotplug Ethernet116
iface Ethernet116 inet6 static
mtu 9100
address 2002::1
netmask 64

ifdown/ifup work fine, if it is agreed to use those commands, I will send a PR for this.

Output of show version

(paste your output here)

sonic_installer believes it successfully installed an image even though installation failed due to no space left on device

sonic_installer believes it successfully installed an image even though installation failed due to no space left on device. This can easily lead to bricked devices.

tar: ./aufs/mnt: Cannot mkdir: No space left on device
tar: ./aufs/mnt: Cannot mkdir: No space left on device
tar: ./aufs/mnt/c3a684c7b1c9267942980e3e25b5f64dbf32ba62443700f7761fd680a3d2028d: Cannot mkdir: No such file or directory
tar: ./aufs/mnt: Cannot mkdir: No space left on device
tar: ./aufs/mnt/43ca488eea2e72224f7c89a4bf5e8d4e3562155a08c18f5315a1b3682ba28cfa: Cannot mkdir: No such file or directory
tar: ./aufs/mnt: Cannot mkdir: No space left on device
tar: ./aufs/mnt/5873e02375f06de23ce8f72a1a2c4fa482a35fecf890a27e30ead5bb678d3295: Cannot mkdir: No such file or directory
tar: ./aufs/mnt: Cannot mkdir: No space left on device
tar: ./aufs/mnt/fb1777a71e888fb68c8c08351c7f937cb59b5b1185bec947b7385487ac28d87a: Cannot mkdir: No such file or directory
tar: ./aufs/mnt: Cannot mkdir: No space left on device
tar: ./aufs/mnt/110f2fc7899a519912c0686fbaaca2381aef15908f02e86fa4b4da94924d70f6: Cannot mkdir: No such file or directory
tar: ./aufs/mnt: Cannot mkdir: No space left on device
tar: ./aufs/mnt/c0d11c08a6f30963a09473b36f43ca8155e59d381c9281b2af166ee18461f39c: Cannot mkdir: No such file or directory
tar: ./aufs/mnt: Cannot mkdir: No space left on device
tar: ./aufs/mnt/799ea39390ea8f73da9fdc5972e48a58f553ec0e1050884ac4c2d0f2b6b0d9e8: Cannot mkdir: No such file or directory
tar: ./aufs/mnt: Cannot mkdir: No space left on device
tar: ./aufs/mnt/a5d88a51ba4b9b1542b62325eab57aae8fbfc1c6ee1ce8103d3b527bf35028bb: Cannot mkdir: No such file or directory
tar: ./aufs/mnt: Cannot mkdir: No space left on device
tar: ./aufs/mnt/7a89ed50becebe352d82d18605737b635677907e71b2c7c79c07c90d28884842: Cannot mkdir: No such file or directory
tar: ./aufs/mnt: Cannot mkdir: No space left on device
tar: ./aufs/mnt/d9a967ad2628dddb189252a7f138e7903f3472a0251d5ad6b2f198d74013965d: Cannot mkdir: No such file or directory
tar: ./aufs/mnt: Cannot mkdir: No space left on device
tar: ./aufs/mnt/6925dedf28e6740cd8ad51416ee6fda74d37a7b0956078a89e867b8adb6fc4a1: Cannot mkdir: No such file or directory
tar: ./aufs/mnt: Cannot mkdir: No space left on device
tar: ./aufs/mnt/f548ff0b407ff5c8a9f914e7990fc38f420df8e233f72f0f6fa07f636a966765: Cannot mkdir: No such file or directory
tar: ./aufs/mnt: Cannot mkdir: No space left on device
tar: ./aufs/mnt/2357d91e38acae23bafe903c8d3e64ddbe6e6cc5941c425a6d6b1c1ed5782e02: Cannot mkdir: No such file or directory
tar: ./tmp: Cannot mkdir: No space left on device
tar: ./trust: Cannot mkdir: No space left on device
tar: ./containers: Cannot mkdir: No space left on device
tar: ./aufs/diff/d9a967ad2628dddb189252a7f138e7903f3472a0251d5ad6b2f198d74013965d/usr/lib/pymodules/python2.7/ndg_httpsclient-0.3.2.egg-info/requires.txt: Cannot create symlink to '/usr/share/pyshared/ndg_httpsclient-0.3.2.egg-info/requires.txt': No space left on device
tar: ./aufs/diff/d9a967ad2628dddb189252a7f138e7903f3472a0251d5ad6b2f198d74013965d/usr/lib/pymodules/python2.7/ndg_httpsclient-0.3.2.egg-info/not-zip-safe: Cannot create symlink to '/usr/share/pyshared/ndg_httpsclient-0.3.2.egg-info/not-zip-safe': No space left on device
tar: ./aufs/diff/d9a967ad2628dddb189252a7f138e7903f3472a0251d5ad6b2f198d74013965d/usr/lib/pymodules/python2.7/ndg_httpsclient-0.3.2.egg-info/top_level.txt: Cannot create symlink to '/usr/share/pyshared/ndg_httpsclient-0.3.2.egg-info/top_level.txt': No space left on device
tar: ./aufs/diff/d9a967ad2628dddb189252a7f138e7903f3472a0251d5ad6b2f198d74013965d/usr/lib/pymodules/python2.7/ndg_httpsclient-0.3.2.egg-info/entry_points.txt: Cannot create symlink to '/usr/share/pyshared/ndg_httpsclient-0.3.2.egg-info/entry_points.txt': No space left on device
tar: ./aufs/diff/d9a967ad2628dddb189252a7f138e7903f3472a0251d5ad6b2f198d74013965d/usr/lib/pymodules/python2.7/ndg_httpsclient-0.3.2.egg-info/namespace_packages.txt: Cannot create symlink to '/usr/share/pyshared/ndg_httpsclient-0.3.2.egg-info/namespace_packages.txt': No space left on device
tar: ./aufs/diff/d9a967ad2628dddb189252a7f138e7903f3472a0251d5ad6b2f198d74013965d/usr/lib/pymodules/python2.7/ndg_httpsclient-0.3.2.egg-info/dependency_links.txt: Cannot create symlink to '/usr/share/pyshared/ndg_httpsclient-0.3.2.egg-info/dependency_links.txt': No space left on device
tar: ./aufs/diff/d9a967ad2628dddb189252a7f138e7903f3472a0251d5ad6b2f198d74013965d/usr/lib/pymodules/python2.7/ndg_httpsclient-0.3.2.egg-info/SOURCES.txt: Cannot create symlink to '/usr/share/pyshared/ndg_httpsclient-0.3.2.egg-info/SOURCES.txt': No space left on device
tar: ./aufs/diff/d9a967ad2628dddb189252a7f138e7903f3472a0251d5ad6b2f198d74013965d/usr/lib/pymodules/python2.7/ndg/httpsclient/ssl_peer_verification.py: Cannot create symlink to '/usr/share/pyshared/ndg/httpsclient/ssl_peer_verification.py': No space left on device
tar: ./aufs/diff/d9a967ad2628dddb189252a7f138e7903f3472a0251d5ad6b2f198d74013965d/usr/lib/pymodules/python2.7/ndg/httpsclient/test/scripts/openssl_https_server.sh: Cannot create symlink to '/usr/share/pyshared/ndg/httpsclient/test/scripts/openssl_https_server.sh': No space left on device
tar: ./aufs/diff/7a89ed50becebe352d82d18605737b635677907e71b2c7c79c07c90d28884842/usr/lib/pymodules/python2.7/ndg_httpsclient-0.3.2.egg-info/requires.txt: Cannot create symlink to '/usr/share/pyshared/ndg_httpsclient-0.3.2.egg-info/requires.txt': No space left on device
tar: ./aufs/diff/7a89ed50becebe352d82d18605737b635677907e71b2c7c79c07c90d28884842/usr/lib/pymodules/python2.7/ndg_httpsclient-0.3.2.egg-info/not-zip-safe: Cannot create symlink to '/usr/share/pyshared/ndg_httpsclient-0.3.2.egg-info/not-zip-safe': No space left on device
tar: ./aufs/diff/7a89ed50becebe352d82d18605737b635677907e71b2c7c79c07c90d28884842/usr/lib/pymodules/python2.7/ndg_httpsclient-0.3.2.egg-info/top_level.txt: Cannot create symlink to '/usr/share/pyshared/ndg_httpsclient-0.3.2.egg-info/top_level.txt': No space left on device
tar: ./aufs/diff/7a89ed50becebe352d82d18605737b635677907e71b2c7c79c07c90d28884842/usr/lib/pymodules/python2.7/ndg_httpsclient-0.3.2.egg-info/entry_points.txt: Cannot create symlink to '/usr/share/pyshared/ndg_httpsclient-0.3.2.egg-info/entry_points.txt': No space left on device
tar: ./aufs/diff/7a89ed50becebe352d82d18605737b635677907e71b2c7c79c07c90d28884842/usr/lib/pymodules/python2.7/ndg_httpsclient-0.3.2.egg-info/namespace_packages.txt: Cannot create symlink to '/usr/share/pyshared/ndg_httpsclient-0.3.2.egg-info/namespace_packages.txt': No space left on device
tar: ./aufs/diff/7a89ed50becebe352d82d18605737b635677907e71b2c7c79c07c90d28884842/usr/lib/pymodules/python2.7/ndg_httpsclient-0.3.2.egg-info/dependency_links.txt: Cannot create symlink to '/usr/share/pyshared/ndg_httpsclient-0.3.2.egg-info/dependency_links.txt': No space left on device
tar: ./aufs/diff/7a89ed50becebe352d82d18605737b635677907e71b2c7c79c07c90d28884842/usr/lib/pymodules/python2.7/ndg_httpsclient-0.3.2.egg-info/SOURCES.txt: Cannot create symlink to '/usr/share/pyshared/ndg_httpsclient-0.3.2.egg-info/SOURCES.txt': No space left on device
tar: ./aufs/diff/7a89ed50becebe352d82d18605737b635677907e71b2c7c79c07c90d28884842/usr/lib/pymodules/python2.7/ndg/httpsclient/ssl_peer_verification.py: Cannot create symlink to '/usr/share/pyshared/ndg/httpsclient/ssl_peer_verification.py': No space left on device
tar: ./aufs/diff/7a89ed50becebe352d82d18605737b635677907e71b2c7c79c07c90d28884842/usr/lib/pymodules/python2.7/ndg/httpsclient/test/scripts/openssl_https_server.sh: Cannot create symlink to '/usr/share/pyshared/ndg/httpsclient/test/scripts/openssl_https_server.sh': No space left on device
tar: ./aufs/diff/799ea39390ea8f73da9fdc5972e48a58f553ec0e1050884ac4c2d0f2b6b0d9e8/usr/lib/pymodules/python2.7/ndg_httpsclient-0.3.2.egg-info/requires.txt: Cannot create symlink to '/usr/share/pyshared/ndg_httpsclient-0.3.2.egg-info/requires.txt': No space left on device
tar: ./aufs/diff/799ea39390ea8f73da9fdc5972e48a58f553ec0e1050884ac4c2d0f2b6b0d9e8/usr/lib/pymodules/python2.7/ndg_httpsclient-0.3.2.egg-info/not-zip-safe: Cannot create symlink to '/usr/share/pyshared/ndg_httpsclient-0.3.2.egg-info/not-zip-safe': No space left on device
tar: ./aufs/diff/799ea39390ea8f73da9fdc5972e48a58f553ec0e1050884ac4c2d0f2b6b0d9e8/usr/lib/pymodules/python2.7/ndg_httpsclient-0.3.2.egg-info/top_level.txt: Cannot create symlink to '/usr/share/pyshared/ndg_httpsclient-0.3.2.egg-info/top_level.txt': No space left on device
tar: ./aufs/diff/799ea39390ea8f73da9fdc5972e48a58f553ec0e1050884ac4c2d0f2b6b0d9e8/usr/lib/pymodules/python2.7/ndg_httpsclient-0.3.2.egg-info/entry_points.txt: Cannot create symlink to '/usr/share/pyshared/ndg_httpsclient-0.3.2.egg-info/entry_points.txt': No space left on device
tar: ./aufs/diff/799ea39390ea8f73da9fdc5972e48a58f553ec0e1050884ac4c2d0f2b6b0d9e8/usr/lib/pymodules/python2.7/ndg_httpsclient-0.3.2.egg-info/namespace_packages.txt: Cannot create symlink to '/usr/share/pyshared/ndg_httpsclient-0.3.2.egg-info/namespace_packages.txt': No space left on device
tar: ./aufs/diff/799ea39390ea8f73da9fdc5972e48a58f553ec0e1050884ac4c2d0f2b6b0d9e8/usr/lib/pymodules/python2.7/ndg_httpsclient-0.3.2.egg-info/dependency_links.txt: Cannot create symlink to '/usr/share/pyshared/ndg_httpsclient-0.3.2.egg-info/dependency_links.txt': No space left on device
tar: ./aufs/diff/799ea39390ea8f73da9fdc5972e48a58f553ec0e1050884ac4c2d0f2b6b0d9e8/usr/lib/pymodules/python2.7/ndg_httpsclient-0.3.2.egg-info/SOURCES.txt: Cannot create symlink to '/usr/share/pyshared/ndg_httpsclient-0.3.2.egg-info/SOURCES.txt': No space left on device
tar: ./aufs/diff/799ea39390ea8f73da9fdc5972e48a58f553ec0e1050884ac4c2d0f2b6b0d9e8/usr/lib/pymodules/python2.7/ndg/httpsclient/ssl_peer_verification.py: Cannot create symlink to '/usr/share/pyshared/ndg/httpsclient/ssl_peer_verification.py': No space left on device
tar: ./aufs/diff/799ea39390ea8f73da9fdc5972e48a58f553ec0e1050884ac4c2d0f2b6b0d9e8/usr/lib/pymodules/python2.7/ndg/httpsclient/test/scripts/openssl_https_server.sh: Cannot create symlink to '/usr/share/pyshared/ndg/httpsclient/test/scripts/openssl_https_server.sh': No space left on device
tar: Exiting with failure status due to previous errors
+ echo SWI=flash:image-20170725.09/.sonic-boot.swi
+ rm -f /tmp/sonic_image.swi
+ sync



+ [ -z 1 ]
+ exit 0


Done
root@sonic:/tmp# df -h
Filesystem      Size  Used Avail Use% Mounted on
root-aufs       1.9G  1.5G  346M  81% /
tmpfs           794M  7.9M  786M   1% /run
/dev/sda1       1.9G  1.5G  346M  81% /host
/dev/loop1       93M  3.8M   83M   5% /var/log
devtmpfs         10M     0   10M   0% /dev
tmpfs           2.0G  984K  2.0G   1% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           2.0G     0  2.0G   0% /sys/fs/cgroup
root@sonic:/tmp# sonic_installer list
Current: SONiC-OS-20170725.08
Next: SONiC-OS-20170725.09
Available: 
SONiC-OS-20170725.09
SONiC-OS-20170725.08

Does sfputil/main.py get platform success in current version??


BUG REPORT INFORMATION

sfputil/main.py platform_key define maybe not revise for new design.

Description
In sfputil/main.py HWSKU_KEY and PLATFORM_KEY define:
HWSKU_KEY = "DEVICE_METADATA['localhost']['hwsku']"
PLATFORM_KEY = 'platform'

Steps to reproduce the issue

  1. sudo sfputil version

Describe the results you received
Failed to load platform module 'sfputil': [Errno 2] No such file or directory

Describe the results you expected
sfputil version 2.0

Additional information you deem important (e.g. issue happens only occasionally)
this issue is get platform string fail cause sfputil not find.

sonic_installer failed to remove previous image

sonic_installer remove SONiC-OS-20170515.01
Image will be removed, continue? [y/N]: y
Removing image root filesystem...
Traceback (most recent call last):
  File "/usr/bin/sonic_installer", line 9, in <module>
    load_entry_point('sonic-utilities==1.1', 'console_scripts', 'sonic_installer')()
  File "/usr/lib/python2.7/dist-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python2.7/dist-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python2.7/dist-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python2.7/dist-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/sonic_installer/main.py", line 226, in remove
    shutil.rmtree(HOST_PATH + '/' + image_dir)
  File "/usr/lib/python2.7/shutil.py", line 247, in rmtree
    rmtree(fullname, ignore_errors, onerror)
  File "/usr/lib/python2.7/shutil.py", line 247, in rmtree
    rmtree(fullname, ignore_errors, onerror)
  File "/usr/lib/python2.7/shutil.py", line 247, in rmtree
    rmtree(fullname, ignore_errors, onerror)
  File "/usr/lib/python2.7/shutil.py", line 247, in rmtree
    rmtree(fullname, ignore_errors, onerror)
  File "/usr/lib/python2.7/shutil.py", line 247, in rmtree
    rmtree(fullname, ignore_errors, onerror)
  File "/usr/lib/python2.7/shutil.py", line 247, in rmtree
    rmtree(fullname, ignore_errors, onerror)
  File "/usr/lib/python2.7/shutil.py", line 247, in rmtree
    rmtree(fullname, ignore_errors, onerror)
  File "/usr/lib/python2.7/shutil.py", line 241, in rmtree
    fullname = os.path.join(path, name)
  File "/usr/lib/python2.7/posixpath.py", line 80, in join
    path += '/' + b
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 2: ordinal not in range(128)

Add build tests for scripts

Especially for minigraph.py dependent scripts.
Make sure that changing minigraph.py will not affect the output of the scripts.

'clear counters' clear the screen instead of zeroing the counters

hi Team,

SONIC's clear command does not exist.
For example when I try clearing ACL counters I'd run clear counters as I get from autocompletion.
The problem is that instead SONIC's clear bash runs its own clear function resulting in a terminal being cleared... And ACL counters are still the same.
I looked for SONIC's clear binary, but it seems not present.
In the end I run

Cleared counters

to get the counters cleared.

admin@sonic:~$ show platform summary 
Platform: x86_64-arista_7050_qx32s
HwSKU: Arista-7050-QX-32S
ASIC: broadcom

admin@sonic:~$ show version
SONiC Software Version: SONiC.master.0-dirty-20180731.122732
Distribution: Debian 8.11
Kernel: 3.16.0-5-amd64
Build commit: d166a01
Build date: Tue Jul 31 12:33:00 UTC 2018
Built by: sonic@crankcees

Docker images:
REPOSITORY                 TAG                              IMAGE ID            SIZE
<none>                     <none>                           7b84987ef6fb        335 MB
<none>                     <none>                           e12b18a856a5        335 MB
<none>                     <none>                           ee1bd35d24f9        335 MB
<none>                     <none>                           f9230f4f1588        255.9 MB
<none>                     <none>                           ea4c3d9b0ca4        255.9 MB
<none>                     <none>                           383681c0bc48        255.9 MB
<none>                     <none>                           ad03f4089835        255.9 MB
<none>                     <none>                           9349748354fc        255.9 MB
<none>                     <none>                           6f0196381d5e        255.9 MB
<none>                     <none>                           cd55e18fb841        255.9 MB
<none>                     <none>                           9aa74753b601        255.9 MB
<none>                     <none>                           9a458a549b4e        255.9 MB
docker-fpm-frr             latest                           d258d27aa99c        260.8 MB
docker-fpm-frr             master.0-dirty-20180731.122732   d258d27aa99c        260.8 MB
docker-orchagent-brcm      latest                           f7c7df94a323        255.9 MB
docker-orchagent-brcm      master.0-dirty-20180731.122732   f7c7df94a323        255.9 MB
docker-teamd               latest                           c252bb5e7e04        255.6 MB
docker-teamd               master.0-dirty-20180731.122732   c252bb5e7e04        255.6 MB
docker-syncd-brcm          latest                           c85c414424fb        334.9 MB
docker-syncd-brcm          master.0-dirty-20180731.122732   c85c414424fb        334.9 MB
docker-snmp-sv2            latest                           bea162334e14        289.6 MB
docker-snmp-sv2            master.0-dirty-20180731.122732   bea162334e14        289.6 MB
docker-platform-monitor    latest                           dc528dc3a2e5        280.1 MB
docker-platform-monitor    master.0-dirty-20180731.122732   dc528dc3a2e5        280.1 MB
docker-lldp-sv2            latest                           138bff0acbf3        269.2 MB
docker-lldp-sv2            master.0-dirty-20180731.122732   138bff0acbf3        269.2 MB
docker-database            latest                           b58c4aeaeb44        250.8 MB
docker-database            master.0-dirty-20180731.122732   b58c4aeaeb44        250.8 MB
docker-dhcp-relay          latest                           98405c6617c3        252.1 MB
docker-dhcp-relay          master.0-dirty-20180731.122732   98405c6617c3        252.1 MB
docker-router-advertiser   latest                           de8e563464a5        248.4 MB
docker-router-advertiser   master.0-dirty-20180731.122732   de8e563464a5        248.4 MB

decode-syseeprom cannot save cache

Although we have the /var/cache/ssw/decode-syseeprom folder for saving the eeprom cache, this functionality never works. It seems that there's a bug in the /usr/bin/decode-syseeprom script line 115. Need to fix this issue so as to speed up the script read time.

teamshow returns error if minigraph.xml is not present

Description
teamshow returns error if minigraph.xml is not present.

Steps to reproduce the issue

  1. Delete/rename minigraph.xml from /etc/sonic/
  2. Execute teamshow

Describe the results you received

admin@str-z9100-acs-2:~$ teamshow
Error reading file '/etc/sonic/minigraph.xml': failed to load external entity "/etc/sonic/minigraph.xml"

Describe the results you expected

admin@str-z9100-acs-2:~$ teamshow
Flags: A - active, I - inactive, Up - up, Dw - Down, N/A - not available, S - selected, D - deselected
  No.  Team Dev         Protocol     Ports
-----  ---------------  -----------  --------------
 0001  PortChannel0001  LACP(A)(Up)  Ethernet112(S)
 0002  PortChannel0002  LACP(A)(Up)  Ethernet116(S)
 0003  PortChannel0003  LACP(A)(Up)  Ethernet120(S)
 0004  PortChannel0004  LACP(A)(Up)  Ethernet124(S)

Output of show version

admin@str-z9100-acs-2:~$ show version 
SONiC Software Version: SONiC.master.0-4daf002
Distribution: Debian 8.10
Kernel: 3.16.0-5-amd64
Build commit: 4daf002
Build date: Wed Mar 28 22:03:01 UTC 2018
Built by: localadmin@prince-vm0

Docker images:
REPOSITORY                 TAG                 IMAGE ID            SIZE
docker-syncd-brcm          latest              f6252d17263d        359.1 MB
docker-syncd-brcm          master.0-4daf002    f6252d17263d        359.1 MB
docker-orchagent-brcm      latest              3fb0380ae5f5        288 MB
docker-orchagent-brcm      master.0-4daf002    3fb0380ae5f5        288 MB
docker-lldp-sv2            latest              851b4df46ec8        298.1 MB
docker-lldp-sv2            master.0-4daf002    851b4df46ec8        298.1 MB
docker-dhcp-relay          latest              42535ff8b568        281.1 MB
docker-dhcp-relay          master.0-4daf002    42535ff8b568        281.1 MB
docker-database            latest              3f7ec3e70d18        279.7 MB
docker-database            master.0-4daf002    3f7ec3e70d18        279.7 MB
docker-teamd               latest              931622a3c517        285.1 MB
docker-teamd               master.0-4daf002    931622a3c517        285.1 MB
docker-snmp-sv2            latest              9119f6a50c8c        320.3 MB
docker-snmp-sv2            master.0-4daf002    9119f6a50c8c        320.3 MB
docker-router-advertiser   latest              1763a3241bb8        277.4 MB
docker-router-advertiser   master.0-4daf002    1763a3241bb8        277.4 MB
docker-platform-monitor    latest              9821e05268ef        298.3 MB
docker-platform-monitor    master.0-4daf002    9821e05268ef        298.3 MB
docker-fpm-quagga          latest              61917701bc96        290.6 MB
docker-fpm-quagga          master.0-4daf002    61917701bc96        290.6 MB

show platform show mlnx option on non mlnx platform

Description

Steps to reproduce the issue
1.
2.
3.

Describe the results you received

root@sonic:/# show platform
Usage: show platform [OPTIONS] COMMAND [ARGS]...

 Show platform-specific hardware info

Options:
 -?, -h, --help  Show this message and exit.

Commands:
 mlnx       Mellanox platform specific configuration...
 psustatus  Show PSU status information
 summary    Show hardware platform information
 syseeprom  Show system EEPROM information
i'm on a dell with tomahawk and i see mlnx option in the cmd line?

Describe the results you expected

Additional information you deem important (e.g. issue happens only occasionally)

Output of show version

(paste your output here)

Does sonic support new format of /etc/machine.conf which is from ONIE?

ONIE page description about machine.conf:
https://opencomputeproject.github.io/onie/developers/multiple_cpu.html

======================================================
It cause sonic_installer fail to install sonic image.

root@sonic:/tmp# sonic_installer install ./sonic-broadcom.bin
New image will be installed, continue? [y/N]: y
Command: ././sonic-broadcom.bin
/tmp/tmp.ISY9gRmCsy/installer/install.sh: 8: .: Can't open /etc/machine-build.conf
Verifying image checksum ... OK.
Preparing image archive ... OK.
Installing SONiC in SONiC
ONIE Installer: platform: x86_64-broadcom-r0

root@sonic:/tmp#

Error reading port info ([Errno 2] No such file or directory: '/usr/share/sonic/device/x86_64-dell_s6000_s1220-r0//portmap.ini')

HW:

root@sonic:~# show platform summary
Platform: x86_64-dell_s6000_s1220-r0
HwSKU: 
ASIC: broadcom

SW:

root@sonic:/var/log/swss# show version
SONiC Software Version: SONiC.HEAD.327-686e227
Distribution: Debian 8.9
Kernel: 3.16.0-4-amd64
Build commit: 686e227
Build date: Wed Sep 13 12:32:55 UTC 2017
Built by: johnar@jenkins-worker-3

Docker images:
REPOSITORY                TAG                 IMAGE ID            SIZE
docker-syncd-brcm         latest              5ce882be887a        319.2 MB
docker-orchagent-brcm     latest              b4a7b1d64508        259.2 MB
docker-lldp-sv2           latest              4c179e91e1ef        257.4 MB
docker-dhcp-relay         latest              4846ced20cc6        254.3 MB
docker-database           latest              fd37fdc060c6        252.6 MB
docker-snmp-sv2           latest              17a49c8ef0a4        292.1 MB
docker-teamd              latest              a03717cbcd16        255.5 MB
docker-platform-monitor   latest              cf9b979c18d1        271 MB
docker-fpm-quagga         latest              a1938d67c876        262 MB


Error:

root@sonic:~# show interfaces sfp
Command: sudo sfputil show eeprom
Error reading port info ([Errno 2] No such file or directory: '/usr/share/sonic/device/x86_64-dell_s6000_s1220-r0//portmap.ini')


BGP changes done in https://github.com/Azure/sonic-utilities/pull/102 should be reverted

BGP has and supports non-IP address families (l2vpn, ls are such examples) but quagga only supports ipv4 and ipv6. Since sonic cli is newly developed from scratch it should attempt to follow the proper convention of "show bgp " at minimum. Vendors have allowed "show ip bgp" to follow the same convention for backwards compatibility reasons. In this case, ip is not really meant to mean or imply ipv4. That is also the reason why under that cli of many vendors, you will see ipv6 options as well as other options. In sonic we don't need to be backwards compatible since sonic's cli is new. Removing "show bgp" and only allowing "show ip bgp" and "show ipv6 bgp" is a change that not only will cause confusion in the future, but in comparison to "show bgp" less flexible, less desirable. The BGP changes done in #102 need to be reverted and show bgp needs to be retained. What you decide about "show ipv6 bgp" is at your discretion. Just be advised that FRR has no directly mapped cli for that.

[sonic_installer] should not return fail (rc=1) if new image is the same as what has been installed

sonic_installer return 1 if the upgrade new image is the same as what has been installed

Steps to reproduce the issue

  1. use sonic_installer to upgrade SONiC to same image version

Describe the results you received
shell returns 1 which indicate fail

Describe the results you expected
could it exit with success while do not do "reinstall"?

Additional information you deem important (e.g. issue happens only occasionally)

Output of show version

(paste your output here)

portstat/teamshow/aclshow sometimes fails to connect to database

When calling the portstat, teamshow or aclshow, sometimes it keeps trying to connect to database and stuck forever. The output is as follows. This issue is random and not happen every time.

^CTraceback (most recent call last):
  File "/usr/bin/portstat", line 333, in <module>
    main()
  File "/usr/bin/portstat", line 285, in main
    portstat = Portstat()
  File "/usr/bin/portstat", line 54, in __init__
    self.db.connect(self.db.COUNTERS_DB)
  File "/usr/local/lib/python2.7/dist-packages/swsssdk/interface.py", line 179, in connect
    self._persistent_connect(db_name)
  File "/usr/local/lib/python2.7/dist-packages/swsssdk/interface.py", line 210, in _persistent_connect
    time.sleep(t_wait)
KeyboardInterrupt
root@str-a7050-acs-1:/home/admin# portstat

Portstat : TypeError: 'NoneType' object is not iterable

HW :

    "aboot_platform": "x86_64-arista_7050_qx32s", 
    "aboot_version": "4.0.4-2086886", 
    "aboot_machine": "arista_7050_qx32s", 
    "aboot_build_date": "2014-09-25T06:28:52.000000000", 
    "minigraph_hwsku": "Arista-7050-QX32S"

Error

root@sonic:/usr/share/sonic/device/x86_64-arista_7050_qx32s# portstat 
Traceback (most recent call last):
  File "/usr/bin/portstat", line 333, in <module>
    main()
  File "/usr/bin/portstat", line 286, in main
    cnstat_dict = portstat.get_cnstat()
  File "/usr/bin/portstat", line 80, in get_cnstat
    for port in natsorted(counter_port_name_map):
  File "/usr/lib/python2.7/dist-packages/natsort/natsort.py", line 328, in natsorted
    key=natsort_keygen(key, alg=alg))
TypeError: 'NoneType' object is not iterable

need a command line to reset SONiC to factory default

Description
sonic upgrade "sonic-installer" won't clean up some wrong init configuration.
Need a command that can reset to current image manufacture default.

Steps to reproduce the issue
1.
2.
3.

Describe the results you received

Describe the results you expected

Additional information you deem important (e.g. issue happens only occasionally)

Output of show version

(paste your output here)

aclshow -d shows incorrect port number if user add multiple ACL_TABLE and bind to different port sets

Description
aclshow -d shows incorrect port information

Steps to reproduce the issue

  1. Create two acl table, make sure these two tables bind to different port set.
  2. Attach ACL rules to this two ACL tables by acl-loader
  3. Check the port information in each ACL rule, the port information is incorrect.

I checked the aclshow code and found the 'ports' variable is getting from the first for loop, but is used in the second loop, that is, in the second loop, while the program iterates the rule and print the associated information, they use the same 'ports' variable.

    for table_name in self.acl_tables.keys():
        ports = self.acl_tables[table_name]['ports']
        header = "ACL Table: " + table_name
        print(header)
        print("=" * len(header))
        table_props = []
        table = self.acl_tables[table_name]
        for tk in table.keys():
            line = [adj_len(tk, mlen), table[tk]]
            table_props.append(line)
        print(tabulate(table_props, headers=['Property', 'Value']), "\n")

    for table_name, rule_name in self.acl_rules.keys():
        rule_props = []
        rule = self.acl_rules[table_name, rule_name]
        header = "ACL Rule: " + rule_name
        print(header)
        print("="*len(header))
        for rk in rule.keys():
            line = [adj_len(rk, mlen), rule[rk]]
            rule_props.append(line)
        rule_props.append([adj_len(PACKETS_COUNTER, mlen), self.get_counter_value((table_name, rule_name), 'packets')])
        rule_props.append([adj_len(BYTES_COUNTER, mlen), self.get_counter_value((table_name, rule_name), 'bytes')])
        rule_props.append([adj_len('ports', mlen), ports])
        print(tabulate(rule_props, headers=['Property', 'Value']), "\n")

The code I checked is in the commit:
commit 242f86d (HEAD -> master, origin/master, origin/HEAD)
Author: Joe LeVeque [email protected]
Date: Mon Apr 23 13:43:16 2018 -0700

teamshow throws KeyError when no member in team

When the team instance doesn't have any member, it will throw KeyError exception.

root@str-msn2700-04:/home/admin# teamshow
Traceback (most recent call last):
File "/usr/bin/teamshow", line 134, in
main()
File "/usr/bin/teamshow", line 130, in main
team.get_teamshow_result()
File "/usr/bin/teamshow", line 109, in get_teamshow_result
for port in json_info['ports']:
KeyError: 'ports'

Add port channel status to teamshow?

Flags: A - active, I - inactive, N/A - Not Available, S - selected, D - deselected
  No.  Team Dev       Protocol    Ports
-----  -------------  ----------  ---------------------------
   24  PortChannel24  LACP(A)     Ethernet28(S) Ethernet24(S)
   48  PortChannel48  LACP(A)     Ethernet52(S) Ethernet48(S)
   16  PortChannel16  LACP(A)     Ethernet20(S) Ethernet16(S)
   32  PortChannel32  LACP(A)     Ethernet32(S) Ethernet36(S)
   56  PortChannel56  LACP(A)     Ethernet60(S) Ethernet56(S)
   40  PortChannel40  LACP(A)     Ethernet44(S) Ethernet40(S)
    0  PortChannel0   LACP(A)     Ethernet0(D) Ethernet4(S)
    8  PortChannel8   LACP(A)     Ethernet8(S) Ethernet12(S)

It appears that PortChannel0 is DOWN due to the min-links setting. I doubt if we need to display the UP/DOWN status of the port channel in this teamshow utility.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.