Return commands key instead of xml in result for junos rm (#62041)

Fixes https://github.com/ansible/ansible/issues/61773

*  Change `xml` key name to `commands` key to be in sync with
   other platform resource modules.

(cherry picked from commit ff53ca76b8)
pull/62162/head
Ganesh Nalawade 5 years ago committed by Toshio Kuratomi
parent 6966f7ebe0
commit 6ecf17ee4d

@ -0,0 +1,2 @@
bugfixes:
- Return commands key instead of xml in result for junos resource module (https://github.com/ansible/ansible/issues/61773)

@ -76,7 +76,7 @@ class Interfaces(ConfigBase):
if self._module._diff: if self._module._diff:
result['diff'] = {'prepared': diff} result['diff'] = {'prepared': diff}
result['xml'] = config_xmls result['commands'] = config_xmls
changed_interfaces_facts = self.get_interfaces_facts() changed_interfaces_facts = self.get_interfaces_facts()

@ -77,7 +77,7 @@ class L2_interfaces(ConfigBase):
if self._module._diff: if self._module._diff:
result['diff'] = {'prepared': diff} result['diff'] = {'prepared': diff}
result['xml'] = config_xmls result['commands'] = config_xmls
changed_l2_interfaces_facts = self.get_l2_interfaces_facts() changed_l2_interfaces_facts = self.get_l2_interfaces_facts()

@ -81,7 +81,7 @@ class L3_interfaces(ConfigBase):
if self._module._diff: if self._module._diff:
result['diff'] = {'prepared': diff} result['diff'] = {'prepared': diff}
result['xml'] = config_xmls result['commands'] = config_xmls
changed_interfaces_facts = self.get_l3_interfaces_facts() changed_interfaces_facts = self.get_l3_interfaces_facts()

@ -75,7 +75,7 @@ class Lacp(ConfigBase):
if self._module._diff: if self._module._diff:
result['diff'] = {'prepared': diff} result['diff'] = {'prepared': diff}
result['xml'] = config_xmls result['commands'] = config_xmls
changed_lacp_facts = self.get_lacp_facts() changed_lacp_facts = self.get_lacp_facts()

@ -73,7 +73,7 @@ class Lacp_interfaces(ConfigBase):
if self._module._diff: if self._module._diff:
result['diff'] = {'prepared': diff} result['diff'] = {'prepared': diff}
result['xml'] = config_xmls result['commands'] = config_xmls
changed_lacp_interfaces_facts = self.get_lacp_interfaces_facts() changed_lacp_interfaces_facts = self.get_lacp_interfaces_facts()

@ -75,7 +75,7 @@ class Lag_interfaces(ConfigBase):
if self._module._diff: if self._module._diff:
result['diff'] = {'prepared': diff} result['diff'] = {'prepared': diff}
result['xml'] = config_xmls result['commands'] = config_xmls
changed_lag_interfaces_facts = self.get_lag_interfaces_facts() changed_lag_interfaces_facts = self.get_lag_interfaces_facts()

@ -73,7 +73,7 @@ class Lldp_global(ConfigBase):
if self._module._diff: if self._module._diff:
result['diff'] = {'prepared': diff} result['diff'] = {'prepared': diff}
result['xml'] = config_xmls result['commands'] = config_xmls
changed_lldp_global_facts = self.get_lldp_global_facts() changed_lldp_global_facts = self.get_lldp_global_facts()

@ -74,7 +74,7 @@ class Lldp_interfaces(ConfigBase):
if self._module._diff: if self._module._diff:
result['diff'] = {'prepared': diff} result['diff'] = {'prepared': diff}
result['xml'] = config_xmls result['commands'] = config_xmls
changed_lldp_interfaces_facts = self.get_lldp_interfaces_facts() changed_lldp_interfaces_facts = self.get_lldp_interfaces_facts()

@ -92,7 +92,7 @@ class Vlans(ConfigBase):
if self._module._diff: if self._module._diff:
result['diff'] = {'prepared': diff} result['diff'] = {'prepared': diff}
result['xml'] = config_xmls result['commands'] = config_xmls
changed_vlans_facts = self.get_vlans_facts() changed_vlans_facts = self.get_vlans_facts()

@ -20,8 +20,8 @@
- assert: - assert:
that: that:
- result is changed - result is changed
- "'<nc:address><nc:name>192.168.100.1/24</nc:name></nc:address>' in result.xml[0]" - "'<nc:address><nc:name>192.168.100.1/24</nc:name></nc:address>' in result.commands[0]"
- "'<nc:address><nc:name>10.200.16.20/24</nc:name></nc:address>' in result.xml[0]" - "'<nc:address><nc:name>10.200.16.20/24</nc:name></nc:address>' in result.commands[0]"
- "result.after[0].name == 'ge-1/0/0'" - "result.after[0].name == 'ge-1/0/0'"
- "result.after[0].ipv4[0]['address'] == '192.168.100.1/24'" - "result.after[0].ipv4[0]['address'] == '192.168.100.1/24'"
- "result.after[0].ipv4[1]['address'] == '10.200.16.20/24'" - "result.after[0].ipv4[1]['address'] == '10.200.16.20/24'"
@ -61,8 +61,8 @@
- assert: - assert:
that: that:
- result is changed - result is changed
- "'<nc:address><nc:name>100.64.0.1/10</nc:name></nc:address>' in result.xml[0]" - "'<nc:address><nc:name>100.64.0.1/10</nc:name></nc:address>' in result.commands[0]"
- "'<nc:address><nc:name>100.64.0.2/10</nc:name></nc:address>' in result.xml[0]" - "'<nc:address><nc:name>100.64.0.2/10</nc:name></nc:address>' in result.commands[0]"
- "result.after[0].name == 'ge-1/0/0'" - "result.after[0].name == 'ge-1/0/0'"
- "result.after[0].ipv4[0]['address'] == '192.168.100.1/24'" - "result.after[0].ipv4[0]['address'] == '192.168.100.1/24'"
- "result.after[0].ipv4[1]['address'] == '10.200.16.20/24'" - "result.after[0].ipv4[1]['address'] == '10.200.16.20/24'"
@ -79,7 +79,7 @@
- assert: - assert:
that: that:
- result is changed - result is changed
- "'<nc:name>ge-2/0/0</nc:name><nc:unit><nc:name>0</nc:name><nc:family><nc:inet><nc:address delete=\"delete\"/>' in result.xml[0]" - "'<nc:name>ge-2/0/0</nc:name><nc:unit><nc:name>0</nc:name><nc:family><nc:inet><nc:address delete=\"delete\"/>' in result.commands[0]"
- name: Override all config - name: Override all config
junos_l3_interfaces: junos_l3_interfaces:
@ -96,4 +96,4 @@
- assert: - assert:
that: that:
- result is changed - result is changed
- "'<nc:name>fxp0</nc:name><nc:unit><nc:name>0</nc:name><nc:family><nc:inet><nc:dhcp/></nc:inet>' in result.xml[0]" - "'<nc:name>fxp0</nc:name><nc:unit><nc:name>0</nc:name><nc:family><nc:inet><nc:dhcp/></nc:inet>' in result.commands[0]"

Loading…
Cancel
Save