Commits

Anonymous committed 373eb30

Use --pylint-max-execution-time.
run_command() accepts a list as its first argument.

Comments (0)

Files changed (2)

cheesecake_daemon.py

 
     # Run cheesecake_index with logfile saved into LOG_DIRECTORY.
     execution_start = time.time()
-    code, output = run_command("%s --name %s==%s --keep-log --logfile=%s" % \
-                               (CHEESECAKE_INDEX_PATH,
-                                name,
-                                version,
-                                logname),
+    code, output = run_command([CHEESECAKE_INDEX_PATH,
+                                "--name",
+                                "%s==%s" % (name, version),
+                                "--pylint-max-execution-time=%d" % max(MAX_CHEESECAKE_INDEX_TIMEOUT, MAX_CHEESECAKE_INDEX_TIMEOUT - 60),
+                                "--keep-log",
+                                "--logfile=%s" % logname],
                                max_timeout=MAX_CHEESECAKE_INDEX_TIMEOUT)
     execution_end = time.time()
 
     >>> run_command('/bin/cat', max_timeout=0.2)
     (1, 'Time exceeded')
     """
-    arglist = cmd.split()
+    if isinstance(cmd, str):
+        arglist = cmd.split()
+    else:
+        arglist = cmd
 
     output = os.tmpfile()
     try: