Make test-module work in v2

- `jsonify` moved from `ansible.utils` to `ansible.parsing.utils.jsonify`
- I don't see `ansible.utils.parse_json` anymore so I used `json.loads`.
pull/11449/head
Marc Abramowitz 10 years ago
parent 468770c894
commit ea6ec3bf2c

@ -35,6 +35,7 @@ import subprocess
import traceback
import optparse
import ansible.utils as utils
from ansible.parsing.utils.jsonify import jsonify
import ansible.module_common as module_common
import ansible.constants as C
@ -75,7 +76,7 @@ def write_argsfile(argstring, json=False):
argsfile = open(argspath, 'w')
if json:
args = utils.parse_kv(argstring)
argstring = utils.jsonify(args)
argstring = jsonify(args)
argsfile.write(argstring)
argsfile.close()
return argspath
@ -150,7 +151,7 @@ def runtest( modfile, argspath):
print "RAW OUTPUT"
print out
print err
results = utils.parse_json(out)
results = json.loads(out)
except:
print "***********************************"
print "INVALID OUTPUT FORMAT"
@ -160,7 +161,7 @@ def runtest( modfile, argspath):
print "***********************************"
print "PARSED OUTPUT"
print utils.jsonify(results,format=True)
print jsonify(results,format=True)
def rundebug(debugger, modfile, argspath):
"""Run interactively with console debugger."""

Loading…
Cancel
Save