Continuing refactoring of runners + status additions

This commit is contained in:
Joshua Harlow
2012-06-04 13:04:34 -07:00
parent 885ce09c4a
commit 16cb957300
6 changed files with 78 additions and 30 deletions

View File

@@ -14,6 +14,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import errno
import fileinput
import getpass
import grp
@@ -354,6 +355,20 @@ def _array_begins_with(haystack, needle):
return True
def is_running(pid):
# Check proc
if exists("/proc/%s" % (pid)):
return True
# Try a slightly more aggressive way...
try:
os.kill(pid, 0)
except OSError as e:
if e.errno == errno.EPERM:
return True
return False
return True
def mkdirslist(path):
LOG.debug("Determining potential paths to create for target path %r" % (path))
dirs_possible = _explode_form_path(path)