Commit 82912d87 authored by Rafael Monnerat's avatar Rafael Monnerat

promise.is_process_older_than_dependency_set: Verbose a bit of information when fail.

parent 9bfb67ca
......@@ -12,7 +12,7 @@ import sys
import os
import errno
import argparse
import time
import psutil
ignored_extension_set = set([".pyc"])
......@@ -29,6 +29,10 @@ def moduleIsModifiedSince(top, since, followlinks=False):
if ext in ignored_extension_set:
continue
if since < os.stat(os.path.join(root, name)).st_mtime:
print "%s was modified since the process started." % \
os.path.join(root, name)
print "Process Time %s < Last modidified file %s" % (time.ctime(since),
time.ctime(os.stat(os.path.join(root, name)).st_mtime))
return True
return False
......@@ -37,6 +41,7 @@ def isProcessOlderThanDependencySet(pid, python_path_list, kill=False):
start_time = process.create_time()
if any(moduleIsModifiedSince(product_path, start_time) for product_path in python_path_list):
if kill:
print "Terminating process %s with pid %s" % (process.name(), pid)
process.terminate()
return True
return False
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment