예제 #1
0
def grid_status(subject, argv):
    if not HubController.is_running():
        ok("Grid is not running")
        sys.exit(1)
    grid = HubController.get_status()
    ok("GridIP: " + grid['Ip'] + ' Firefox Nodes: ' +
       str(grid['firefox_count']) + ' PhantomJS Nodes: ' +
       str(grid['phantomjs_count']) + ' Chrome Nodes: ' +
       str(grid['chrome_count']))
예제 #2
0
파일: shell.py 프로젝트: ram1fer/dsgrid
def start(subject, argv):
    if HubController.is_running():
        warning("Hub already running")
        sys.exit(1)

    info("Starting up grid...")
    status = HubController.start()
    if not status:
        fail("Hub failed to start")
        sys.exit(1)
    ok("Hub is Ready!")
예제 #3
0
def start(subject, argv):
    if HubController.is_running():
        warning("Hub already running")
        sys.exit(1)

    info("Starting up grid...")
    status = HubController.start()
    if not status:
        fail("Hub failed to start")
        sys.exit(1)
    ok("Hub is Ready!")
예제 #4
0
파일: shell.py 프로젝트: ram1fer/dsgrid
def grid_status(subject, argv):
    if not HubController.is_running():
        ok("Grid is not running")
        sys.exit(1)
    grid = HubController.get_status()
    ok(
        "GridIP: "
        + grid["Ip"]
        + " Firefox Nodes: "
        + str(grid["firefox_count"])
        + " PhantomJS Nodes: "
        + str(grid["phantomjs_count"])
        + " Chrome Nodes: "
        + str(grid["chrome_count"])
    )
예제 #5
0
def nodes(subject, argv):

    if len(argv) == 0:
        fail("Missing node action")

    action = argv.pop(0)
    if action == 'add':
        if len(argv) == 0:
            fail("Missing browser, use phantomjs|firefox|chrome")

        browser = argv.pop(0)
        if not HubController.is_valid_browser(browser):
            fail("Invalid browser please use phantomjs|firefox|chrome")

        info("Adding node...")
        status = HubController.add(browser)
        if not status:
            fail("Failed to start node")

        ok("Node Added Successfully!")

    elif action == 'stop':
        info("Stopping nodes...")
        HubController.stop_nodes()
        ok("Nodes stopped")
    elif action == 'restart':
        info("Restarting nodes...")
        browser = None
        if len(argv) == 1 and not HubController.is_valid_browser(argv.pop(0)):
            fail(
                'Restarting by browser requires either phantomjs, chrome or firefox'
            )

        HubController.restart_nodes(browser)
        ok("Nodes restarted")
    elif action == 'rebuild':
        # TODO:
        print "Rebuild Nodes optional by browser"
    else:
        fail("Unknown node action: " + action)
예제 #6
0
파일: shell.py 프로젝트: ram1fer/dsgrid
def nodes(subject, argv):

    if len(argv) == 0:
        fail("Missing node action")

    action = argv.pop(0)
    if action == "add":
        if len(argv) == 0:
            fail("Missing browser, use phantomjs|firefox|chrome")

        browser = argv.pop(0)
        if not HubController.is_valid_browser(browser):
            fail("Invalid browser please use phantomjs|firefox|chrome")

        info("Adding node...")
        status = HubController.add(browser)
        if not status:
            fail("Failed to start node")

        ok("Node Added Successfully!")

    elif action == "stop":
        info("Stopping nodes...")
        HubController.stop_nodes()
        ok("Nodes stopped")
    elif action == "restart":
        info("Restarting nodes...")
        browser = None
        if len(argv) == 1 and not HubController.is_valid_browser(argv.pop(0)):
            fail("Restarting by browser requires either phantomjs, chrome or firefox")

        HubController.restart_nodes(browser)
        ok("Nodes restarted")
    elif action == "rebuild":
        # TODO:
        print "Rebuild Nodes optional by browser"
    else:
        fail("Unknown node action: " + action)
예제 #7
0
파일: shell.py 프로젝트: ram1fer/dsgrid
def shutdown(subject, argv):
    if not HubController.is_running():
        fail("Hub is not running")
        sys.exit(1)
    info("Shutting down grid...")
    HubController.shutdown()
예제 #8
0
파일: shell.py 프로젝트: MEDBEDb/dsgrid
def grid_status(subject, argv):
    if not HubController.is_running():
        ok("Grid is not running")
        sys.exit(1)
    grid = HubController.get_status()
    ok("GridIP: " + grid['Ip'] + ' Firefox Nodes: ' + str(grid['firefox_count']) + ' PhantomJS Nodes: ' + str(grid['phantomjs_count']))
예제 #9
0
def shutdown(subject, argv):
    if not HubController.is_running():
        fail("Hub is not running")
        sys.exit(1)
    info("Shutting down grid...")
    HubController.shutdown()