-
Notifications
You must be signed in to change notification settings - Fork 350
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Converted completion helpers from python to bash for performance Previous commit: Added the following commands: show evpn show evpn es show evpn es <es-id> show evpn es detail show evpn es-evi show evpn es-evi detail show evpn es-evi vni <num> show evpn vni show evpn vni detail show evpn vni <num> Updated the following commands: show evpn access-vlan show evpn arp-cache show evpn mac show evpn next-hops show evpn rmac
- Loading branch information
l0crian1
committed
May 16, 2024
1 parent
c6be441
commit 3917e3e
Showing
5 changed files
with
14 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 6 additions & 17 deletions
23
src/completion/list_esi.py → src/completion/list_esi.sh
100644 → 100755
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,20 @@ | ||
#!/usr/bin/env python3 | ||
#!/bin/bash | ||
# | ||
# Copyright (C) 2016-2024 VyOS maintainers and contributors | ||
# Copyright (C) 2024 VyOS maintainers and contributors | ||
# | ||
# This program is free software; you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License version 2 or later as | ||
# published by the Free Software Foundation. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
# | ||
# This script is completion helper to list all configured VNIs that are visible to FRR | ||
# This script is completion helper to list all valid ESEs that are visible to FRR | ||
|
||
import json | ||
from vyos.utils.process import cmd | ||
|
||
def get_esi(): | ||
esiDict = json.loads(cmd(f"vtysh -c 'show evpn es json'")) | ||
esiList = [] | ||
for i in esiDict: | ||
esiList.append(i['esi']) | ||
|
||
print(' '.join(esiList)) | ||
|
||
if __name__ == '__main__': | ||
get_esi() | ||
esiJson=$(vtysh -c 'show evpn es json') | ||
echo "$(echo "$esiJson" | jq -r '.[] | .esi')" |
17 changes: 5 additions & 12 deletions
17
src/completion/list_vni.py → src/completion/list_vni.sh
100644 → 100755
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,20 @@ | ||
#!/usr/bin/env python3 | ||
#!/bin/bash | ||
# | ||
# Copyright (C) 2016-2024 VyOS maintainers and contributors | ||
# Copyright (C) 2024 VyOS maintainers and contributors | ||
# | ||
# This program is free software; you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License version 2 or later as | ||
# published by the Free Software Foundation. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
# | ||
# This script is completion helper to list all configured VNIs that are visible to FRR | ||
|
||
import json | ||
from vyos.utils.process import cmd | ||
|
||
def get_vni(): | ||
vniDict = json.loads(cmd(f"vtysh -c 'show evpn vni json'")) | ||
print(' '.join(vniDict.keys())) | ||
|
||
if __name__ == '__main__': | ||
get_vni() | ||
vniJson=$(vtysh -c 'show evpn vni json') | ||
echo "$(echo "$vniJson" | jq -r 'keys | .[]')" |