Continuing refactoring of runners + status additions
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user