Skip to content

Commit

Permalink
use new newJob function call
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Fiers committed Jun 3, 2012
1 parent ce1453c commit 2d08473
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions lib/python/moa/plugin/system/adhoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ def simple(job, args):
query you for a command to execute (the `process` parameter).
"""

wd = job.wd

wd = job.wd
if not args.force and \
os.path.exists(os.path.join(wd, '.moa', 'template')):
moa.ui.exitError("Job already exists, use -f to override")
Expand All @@ -46,9 +45,9 @@ def simple(job, args):

#make sure the correct hooks are called
sysConf.pluginHandler.run("preNew")

moa.job.newJob(
wd, template='simple',
job = moa.job.newJob(
job, template='simple',
title = args.title,
parameters=params)

Expand All @@ -65,7 +64,7 @@ def exclamateNoJob(job, args, command):
moa.ui.warn("Do not forget to set a title")

job = moa.job.newJob(
wd = job.wd, template='simple',
job, template='simple',
title = title,
parameters = [('process', command)])

Expand Down Expand Up @@ -142,8 +141,9 @@ def createMap(job, args):
params.append(('input', input))
params.append(('output', output))


moa.job.newJob(
wd, template='map',
job, template='map',
title = args.title,
parameters=params)

Expand Down Expand Up @@ -201,7 +201,7 @@ def createReduce(job):
params.append(('output', output))

moa.job.newJob(
wd, template='reduce',
job, template='reduce',
title = options.title,
parameters=params)

Expand All @@ -226,6 +226,8 @@ def createAdhoc(job):
"""
Creates an adhoc job.
"""
l.critical("I don't think this function is ever called!!")

wd = sysConf['cwd']
options = sysConf['options']
args = sysConf['newargs']
Expand Down Expand Up @@ -349,7 +351,7 @@ def createAdhoc(job):
for pk, pv in params:
l.debug('setting parameters %s to %s' % (pk, pv))

moa.job.newJob(wd, template='adhoc',
moa.job.newJob(job, template='adhoc',
title = options.title,
parameters=params)

0 comments on commit 2d08473

Please sign in to comment.