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

fix: get_route_maps not working starting 202211 #14

Merged
merged 1 commit into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
12 changes: 2 additions & 10 deletions _modules/sonic.py
Original file line number Diff line number Diff line change
Expand Up @@ -811,16 +811,8 @@ def get_route_maps():
"FABRIC-IN",
]
"""
# for now we only need the name of the route-maps, ? is a small hack
route_map = __salt__["cmd.run"]("show route-map ?", "").split("\n")

# doing some cleaning
del route_map[2]
del route_map[1]
del route_map[0]
route_map = [r.strip() for r in route_map]

return route_map
cmd = "vtysh -c 'show route-map' | awk '/route-map/ {print $2}' | sort -u"
return __salt__["cmd.shell"](cmd).split("\n")


def _upload_candidate_bgp_config(remote_tmpfile, content):
Expand Down
2 changes: 1 addition & 1 deletion _states/sonic.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def managed(name, templates, context=None, saltenv="base", reload_conf=False):
return ret


def add_user(name, password, public_keys, groups, gid=None, clear_password=True):
def add_user(name, password, public_keys, groups, gid=None, clear_password=True): # noqa: R0917
"""Add user.

To avoid issues, users must have at least a password or a ssh key.
Expand Down
Loading