Giovanni Marco Dall'Olio avatar Giovanni Marco Dall'Olio committed 89a1647

Add: -M, -P --fakebsub_debug and positional arguments; removed qsub specific options

Comments (0)

Files changed (1)

 parser.add_argument('-w', metavar='description', help='Job description - message to be printed when the job is finished?') # STUB
 parser.add_argument('-o', metavar='stdoutfile', help='STDOUT log file') # STUB
 parser.add_argument('-e', metavar='stderrfile', help='STDERR log file') # STUB
+parser.add_argument('-P', metavar='team', help='Team or user name') # STUB
+parser.add_argument('-M', metavar='memory', help='RAM memory required') # STUB
+parser.add_argument('commands', metavar='commands', help='command to be executed', nargs='+') # STUB
+parser.add_argument('--fakebsub_debug', metavar='fakebsub_debug', help='Fake-bsub debug mode') # STUB
 
 #parser.add_argument('--fakeqsub_debug', action='store_true', help='show debug messages', default=False)
 #parser.add_argument('-cwd', action='store_true', help='execute job from current directory', default=False)
 
 # Parse arguments and eventually set debug mode
 args = parser.parse_args()
-if args.debug is True:
+if args.fakebsub_debug is True:
     logging.basicConfig(level=logging.DEBUG)
 
-# Simulate CWD option
-if args.cwd is True:
-    # if cwd is True, the command will be executed from the current directory
-    commandsfile = os.getcwd() + '/' + args.commandsfile
-else:
-    # otherwise, it is better if the absolute url is given
-    os.chdir('/')
-    commandsfile = '/' + args.commandsfile
+print args.commands
+
+
+## Simulate CWD option
+#if args.cwd is True:
+#    # if cwd is True, the command will be executed from the current directory
+#    commandsfile = os.getcwd() + '/' + args.commandsfile
+#else:
+#    # otherwise, it is better if the absolute url is given
+#    os.chdir('/')
+#    commandsfile = '/' + args.commandsfile
 
 # Memory limit should always be given
-if args.l is False:
-    raise MissingParameterException('You forgot to specify the Memory requirements. Example: -l h_vmem=500MB')
-else:
-    if not re.match(('h_vmem=\d+'), args.l, re.I):
-        raise MissingParameterException('You did not specify Memory requirements correctly. Example: -l h_vmem=500MB')
+#if args.l is False:
+#    raise MissingParameterException('You forgot to specify the Memory requirements. Example: -l h_vmem=500MB')
+#else:
+#    if not re.match(('h_vmem=\d+'), args.l, re.I):
+#        raise MissingParameterException('You did not specify Memory requirements correctly. Example: -l h_vmem=500MB')
 
 # Print debugging things
 logging.debug(args)
-logging.debug('launching ' + commandsfile)
+#logging.debug('launching ' + commandsfile)
 
 # Call the bash process
 #subprocess.call([commandsfile])
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.