Skip to content

Commit

Permalink
better error message if there is no job
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Fiers committed Oct 23, 2012
1 parent 5c6902b commit 8a0994c
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/python/moa/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,13 @@ def run_3(wd, exitOnError=True):
if command in sysConf.commands.keys():
comInf = sysConf.commands[command]
if comInf.get('needsJob', False) and not job.isMoa():
moa.ui.exitError(("Must execute 'moa %s' in a directory " +
"containing a Moa job (try moa -h)")
% command)
if command == 'status':
message = "Need a Moa job - try 'moa -h'"
else:
message = "'moa %s' needs a job" % command

moa.ui.message(message)
sys.exit(-1)

sysConf.pluginHandler.run('prepare')
#job.run_hook('prepare') #executed during job initialization
Expand Down

0 comments on commit 8a0994c

Please sign in to comment.