Пример #1
0
#
# 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
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: