def test_vars_basic(): fh, fpath = tempfile.mkstemp() output = None cmdargs = "ansible-playbook -vvvv -i inventory -t basic vartest.yml" cmdargs = shlex.split(cmdargs) try: output = subprocess.check_output(cmdargs, stderr=fh) except: import epdb; epdb.serve() # localhost : ok=3 changed=3 unreachable=0 failed=0 results = {} assert output is not None, "No output from ansible-playbook" lines = output.split("\n") for line in lines: if line.strip().startswith('localhost'): parts = shlex.split(line) for word in parts: if '=' in word: k,v = word.split('=') open("/tmp/awx.log", "a").write("%s\n" % word) results[k] = int(v) assert results != {}, "parsing results failed" assert results['failed'] == 0, "results: %s" % results os.remove(fpath)
def enable_debug(self, params, sender, destination): print("Starting debugger; connect with: " "python3 -c 'import epdb; epdb.connect()'") import epdb epdb.serve()
def _interrupt(*args, **kw): import epdb if hasattr(epdb, 'serve'): epdb.serve() else: epdb.st()
def startDebugger(signum, frame): import epdb epdb.serve(skip=1)
def startDebugger(signum, frame): # pylint: disable=import-error import epdb epdb.serve(skip=1)
def _breakpoint(signum, sigtb): try: import epdb except ImportError: from conary.lib import debugger as epdb epdb.serve()
def handler(signum, sigtb): if serve: epdb.serve() else: epdb.st()
def _interrupt(*args, **kw): try: import epdb except ImportError: from conary.lib import debugger as epdb epdb.serve()
def hdlr(signum, sigtb): epdb.serve()
def epdb(**kw): ''' add a network attachable breakpoint ''' import epdb epdb.serve()
#!/usr/bin/python # -*- coding: utf-8 -*- from ansible.module_utils.basic import AnsibleModule IS_FAILED = True module = AnsibleModule(argument_spec={}) if module._debug: import epdb epdb.serve() if IS_FAILED: module.fail_json(msg="Ouch!") else: module.exit_json(msg="Success!")
def start_debugger(signum, frame): # pylint: disable=import-error import epdb epdb.serve(skip=1)
def _postgresql_query(v): v.dialect = netaddr.mac_pgsql import epdb epdb.serve() return str(v)