update junos_command integration tests (#22213)

fixes integration test to check for full rpc-reply string when
converted from xml.  This is a change from 2.2 as the rpc-reply tag
is no longer stripped off
This commit is contained in:
Peter Sprygada 2017-03-02 16:46:23 -06:00 committed by GitHub
parent 3afc993f3a
commit 911600acf9
9 changed files with 26 additions and 24 deletions

View file

@ -229,15 +229,17 @@ def main():
while retries > 0:
responses = run_commands(module, commands)
for item in list(conditionals):
for index, (resp, cmd) in enumerate(zip(responses, commands)):
if cmd['output'] == 'xml':
if not HAS_JXMLEASE:
module.fail_json(msg='jxmlease is required but does not appear to '
'be installed. It can be installed using `pip install jxmlease`')
for index, (resp, cmd) in enumerate(zip(responses, commands)):
if cmd['output'] == 'xml':
if not HAS_JXMLEASE:
module.fail_json(msg='jxmlease is required but does not appear to '
'be installed. It can be installed using `pip install jxmlease`')
try:
responses[index] = jxmlease.parse(resp)
except:
raise ValueError(resp)
for item in list(conditionals):
try:
if item(responses):
if match == 'any':