[docker-lldp] Fix lldpcli issue when description has special characters (#4133)

Before the fix:
lldpcli configure ports Ethernet96 lldp portidsubtype local 'Eth1/1' description 50G|sonic1|Eth1/3/2
bash: sonic1: command not found
bash: Eth1/3/2: No such file or directory

After fix:
lldpcli configure ports Ethernet96 lldp portidsubtype local 'Eth1/1' description '50G|sonic1|Eth1/3/2'
run successfully.

Signed-off-by: Zhenggen Xu <zxu@linkedin.com>
This commit is contained in:
zhenggen-xu 2020-02-09 20:34:55 -08:00 committed by Ying Xie
parent 726fecaf8b
commit 17d9bdf59c

View File

@ -157,7 +157,7 @@ class LldpManager(object):
# if there is a description available, also configure that # if there is a description available, also configure that
if port_desc: if port_desc:
lldpcli_cmd += " description {}".format(port_desc) lldpcli_cmd += " description '{}'".format(port_desc)
else: else:
log_info("Unable to retrieve description for port '{}'. Not adding port description".format(port_name)) log_info("Unable to retrieve description for port '{}'. Not adding port description".format(port_name))