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

Update ce_stp to fix bugs #61774

Merged
merged 1 commit into from
Sep 18, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 13 additions & 4 deletions lib/ansible/modules/network/cloudengine/ce_stp.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,14 +167,23 @@

import re
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.network.cloudengine.ce import load_config, ce_argument_spec
from ansible.module_utils.network.cloudengine.ce import get_config as get_cli_config
from ansible.module_utils.network.cloudengine.ce import exec_command, load_config, ce_argument_spec


def get_config(module, flags):

cfg = get_cli_config(module, flags)
config = cfg.strip() if cfg else ""
"""Retrieves the current config from the device or cache"""

flags = [] if flags is None else flags

cmd = 'display current-configuration '
cmd += ' '.join(flags)
cmd = cmd.strip()

rc, out, err = exec_command(module, cmd)
if rc != 0:
module.fail_json(msg=err)
config = str(out).strip()
if config.startswith("display"):
configs = config.split("\n")
if len(configs) > 1:
Expand Down