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.
This commit is contained in:
Ganesh Nalawade 2019-09-11 11:06:08 +05:30 committed by GitHub
parent 6fb1d56fdc
commit ff53ca76b8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 15 additions and 15 deletions

View file

@ -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()

View file

@ -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()

View file

@ -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()

View file

@ -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()

View file

@ -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()

View file

@ -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()

View file

@ -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()

View file

@ -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()

View file

@ -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()

View file

@ -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]"