Esempio n. 1
0
def status(args):
    from ambari_windows_service import AmbariServerService

    args.exit_message = None

    statusStr = AmbariServerService.QueryStatus()
    print "Ambari Server is " + statusStr
Esempio n. 2
0
def is_server_runing():
    from ambari_commons.os_windows import SERVICE_STATUS_STARTING, SERVICE_STATUS_RUNNING, SERVICE_STATUS_STOPPING, \
      SERVICE_STATUS_STOPPED, SERVICE_STATUS_NOT_INSTALLED
    from ambari_windows_service import AmbariServerService

    statusStr = AmbariServerService.QueryStatus()
    if statusStr in (SERVICE_STATUS_STARTING, SERVICE_STATUS_RUNNING,
                     SERVICE_STATUS_STOPPING):
        return True, ""
    elif statusStr == SERVICE_STATUS_STOPPED:
        return False, SERVICE_STATUS_STOPPED
    elif statusStr == SERVICE_STATUS_NOT_INSTALLED:
        return False, SERVICE_STATUS_NOT_INSTALLED
    else:
        return False, None