예제 #1
0
파일: server.py 프로젝트: lee212/cloudmesh
#
# SETTING THE BROWSER BASED ON PLATFORM
#
web_browser = "firefox"

debug = True
try:
    debug = cm_config_server().get("cloudmesh.server.debug")
except:
    pass

if debug:
    progress.off()
else:
    progress.on()

PROGRESS.set('Cloudmesh Services', 50)

if sys.platform == 'darwin':
    web_browser = "open"


def execute_command(msg, command, debug):
    _capture = not debug
    if debug:
        banner(msg, debug=debug)
    else:
        PROGRESS.next()
    local(command, capture=_capture)
예제 #2
0
파일: mongo.py 프로젝트: mnozary/cloudmesh
import time
from cloudmesh_common.util import PROGRESS
import progress

PROGRESS.set('Cloudmesh Services', 50)

debug = True
try:
    debug = cm_config_server().get("cloudmesh.server.debug")
except:
    pass

if debug:
    progress.off()
else:
    progress.on()


def get_pid(command):
    with hide('output', 'running', 'warnings'):
        lines = local("ps -ax |fgrep {0}".format(command),
                      capture=True).split("\n")
    pid = None
    line = None
    for line in lines:
        if "fgrep" not in line:
            pid = line.split(" ")[0]
            break
    if pid is None:
        print "No mongod running"
    else: