def beginCatalog(d=None, u=None, h=None, c=None, f=None, **notes):
    return partial(_ctlgThisLine,
                   merge(notes, catalogId=newCatalogId(), 
                         testCase=c or notes.get('testCase', 'ad_hoc_%s'%(time.time())), 
                         targetHost=h or notes.get('targetHost', h),
                         targetUser=u or notes.get('targetUser', u)),
                   _detDB(d), u, h)
Example #2
0
def genRunner(username=None, hostname=None, **notes): #(!:2)
    if username or hostname:
        return _runner(**merge(notes,
                             targetUser=username or environ.get("USER"),
                             targetHost=hostname or gethostname(),
                             preprocessor=makeRemoteCommand))
    return _runner(**notes)
Example #3
0
def _runner(preprocessor=lambda x,**y: split(x), **iNotes):
    return lambda cmd,**notes: _evoke(preprocessor(cmd,**iNotes),
                                      merge(iNotes, notes, command=cmd))
Example #4
0
def _evoke(cmdLst, notes): #(!:2)
    return _execute(merge(notes, started=time()), _popen(cmdLst))
Example #5
0
def _finalizeReport(obs, retGet, stdout, stderr, finishTime):
    return merge(obs, artificeBreed='observation',
                 finished=finishTime, stdout=stdout,
                 stderr=stderr, retCode=retGet(),
                 duration=finishTime-obs.get('started',0))
def showAndRecord(reporter, artifice): #rig:3
    if artifice:
        if "-q" not in argv:
            print "%s"%(artifice)
        return merge(artifice, _id=reporter(artifice))
    return artifice
 def _hf(fn):
     return map(beginCatalog(**merge(args, testCase=path.split(fn)[1])),
                readLines(fn))
def _ctlgThisLine(notes, rptf, user, host, lineTxt):
    global interruptSignalReceived
    if not interruptSignalReceived:
        return showAndRecord(rptf, _ctlgy(notes,user, host, 
                                          *sliceTxt(subst(lineTxt, **notes))))
    return merge(notes, artificeBreed="interrupted")
Example #9
0
 def dostep(**params):
     return merge(params, f(**params))