Skip to content
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
19 changes: 15 additions & 4 deletions ansible_collections/juniper/device/plugins/modules/srx_cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,14 @@ def main():
'reboot': False,
'failed': True}

if junos_module.conn_type == "local":
facts = dict(junos_module.dev.facts)
else:
facts = junos_module.get_facts()
# facts checking has been done as part of persitent connection itself.
junos_module.logger.debug("Check current SRX cluster operational state.")
current_cluster_state = junos_module.dev.facts['srx_cluster']
current_cluster_id = junos_module.dev.facts['srx_cluster_id']
current_cluster_state = facts['srx_cluster']
current_cluster_id = facts['srx_cluster_id']
if current_cluster_id is not None:
current_cluster_id = int(current_cluster_id)
if junos_module.conn_type == "local":
Expand Down Expand Up @@ -275,8 +280,14 @@ def main():
reboot=True, normalize=True
)
else:
resp = junos_module._pyez_conn.set_chassis_cluster_disable()

try:
resp = junos_module._pyez_conn.set_chassis_cluster_disable()
except Exception as err:
# Reboot initiated
# We got Exception ConnectionError
# so handling the exception
resp = None
output = None
if resp is not None:
output = resp.getparent().findtext('.//output')
if output is None:
Expand Down
1 change: 0 additions & 1 deletion tests/pb.juniper_junos_facts.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
- name: Test juniper.device.facts module
hosts: all
connection: local
gather_facts: no
collections:
- juniper.device
Expand Down
25 changes: 0 additions & 25 deletions tests/pb.juniper_junos_persistent_conn.yml

This file was deleted.

1 change: 0 additions & 1 deletion tests/pb.juniper_junos_ping.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
- name: Test juniper.device.ping module
hosts: all
connection: local
gather_facts: no
collections:
- juniper.device
Expand Down
1 change: 0 additions & 1 deletion tests/pb.juniper_junos_pmtud.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
- name: Test juniper.device.pmtud module
hosts: all
connection: local
gather_facts: no
collections:
- juniper.device
Expand Down
1 change: 0 additions & 1 deletion tests/pb.juniper_junos_software.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
hosts: all
collections:
- juniper.device
connection: local
gather_facts: no
vars:
wait_time: 3600
Expand Down
1 change: 0 additions & 1 deletion tests/pb.juniper_junos_software_member.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
hosts: all
collections:
- juniper.device
connection: local
gather_facts: no
vars:
wait_time: 3600
Expand Down
1 change: 0 additions & 1 deletion tests/pb.juniper_junos_srx_cluster.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
- name: Test juniper.device.srx_cluster module
hosts: all
connection: local
gather_facts: no
collections:
- juniper.device
Expand Down
1 change: 0 additions & 1 deletion tests/pb.juniper_junos_system.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
- name: Test juniper.device.system module
hosts: all
connection: local
gather_facts: no
collections:
- juniper.device
Expand Down
1 change: 0 additions & 1 deletion tests/pb.juniper_junos_table.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
- name: Test juniper.device.table PyEZ table/view module.
hosts: all
connection: local
gather_facts: no
collections:
- juniper.device
Expand Down