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 for unwanted cfgenable. #139

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
26 changes: 8 additions & 18 deletions utils/brocade_zoning.py
Original file line number Diff line number Diff line change
Expand Up @@ -741,17 +741,11 @@ def zoning_common(fos_ip_addr, https, fos_version, auth, vfid, result, module, i
if active_cfg is None:
if need_to_save:
if not module.check_mode:
# if something changed and there is already an active cfg
# reenable that cfg
# Just save config when there is no active_cfg value.
# According to documentation of module brocade_zoning_cfg.
ret_code = 0
failed_msg = ""
if cfgname is not None:
failed_msg = "CFG ENABLE failed"
ret_code = cfg_enable(fos_ip_addr, https, fos_version, auth, vfid,
result, checksum, cfgname, timeout)
else:
failed_msg = "CFG SAVE failed"
ret_code = cfg_save(fos_ip_addr, https, fos_version, auth, vfid,
failed_msg = "CFG SAVE failed"
ret_code = cfg_save(fos_ip_addr, https, fos_version, auth, vfid,
result, checksum, timeout)
if ret_code != 0:
ret_code = cfg_abort(fos_ip_addr, https, fos_version,
Expand Down Expand Up @@ -802,15 +796,11 @@ def zoning_common(fos_ip_addr, https, fos_version, auth, vfid, result, module, i
if active_cfg is None:
if need_to_save:
if not module.check_mode:
# Just save config when there is no active_cfg value.
# According to documentation of module brocade_zoning_cfg.
ret_code = 0
failed_msg = ""
if cfgname is not None:
failed_msg = "CFG ENABLE failed"
ret_code = cfg_enable(fos_ip_addr, https, fos_version, auth, vfid,
result, checksum, cfgname, timeout)
else:
failed_msg = "CFG SAVE failed"
ret_code = cfg_save(fos_ip_addr, https, fos_version, auth, vfid,
failed_msg = "CFG SAVE failed"
ret_code = cfg_save(fos_ip_addr, https, fos_version, auth, vfid,
result, checksum, timeout)
if ret_code != 0:
ret_code = cfg_abort(fos_ip_addr, https, fos_version, auth,
Expand Down