Example #1
0
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()
Example #3
0
 def _interrupt(*args, **kw):
     import epdb
     if hasattr(epdb, 'serve'):
         epdb.serve()
     else:
         epdb.st()
Example #4
0
def startDebugger(signum, frame):
    import epdb
    epdb.serve(skip=1)
Example #5
0
def startDebugger(signum, frame):
    # pylint: disable=import-error
    import epdb
    epdb.serve(skip=1)
Example #6
0
 def _interrupt(*args, **kw):
     import epdb
     if hasattr(epdb, 'serve'):
         epdb.serve()
     else:
         epdb.st()
Example #7
0
 def _breakpoint(signum, sigtb):
     try:
         import epdb
     except ImportError:
         from conary.lib import debugger as epdb
     epdb.serve()
Example #8
0
 def handler(signum, sigtb):
     if serve:
         epdb.serve()
     else:
         epdb.st()
Example #9
0
 def _interrupt(*args, **kw):
     try:
         import epdb
     except ImportError:
         from conary.lib import debugger as epdb
     epdb.serve()
Example #10
0
 def hdlr(signum, sigtb):
     epdb.serve()
Example #11
0
def epdb(**kw):
    '''
    add a network attachable breakpoint
    '''
    import epdb
    epdb.serve()
Example #12
0
 def _breakpoint(signum, sigtb):
     try:
         import epdb
     except ImportError:
         from conary.lib import debugger as epdb
     epdb.serve()
Example #13
0
#!/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!")
Example #14
0
def startDebugger(signum, frame):
    import epdb
    epdb.serve(skip=1)
Example #15
0
 def handler(signum, sigtb):
     if serve:
         epdb.serve()
     else:
         epdb.st()
Example #16
0
def start_debugger(signum, frame):
    # pylint: disable=import-error
    import epdb
    epdb.serve(skip=1)
Example #17
0
def _postgresql_query(v):
    v.dialect = netaddr.mac_pgsql
    import epdb

    epdb.serve()
    return str(v)