當前位置: 首頁>>代碼示例>>Python>>正文


Python GaussLog.exitWithError方法代碼示例

本文整理匯總了Python中script.util.GaussLog.GaussLog.exitWithError方法的典型用法代碼示例。如果您正苦於以下問題:Python GaussLog.exitWithError方法的具體用法?Python GaussLog.exitWithError怎麽用?Python GaussLog.exitWithError使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在script.util.GaussLog.GaussLog的用法示例。


在下文中一共展示了GaussLog.exitWithError方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: checkPathUsageParameter

# 需要導入模塊: from script.util.GaussLog import GaussLog [as 別名]
# 或者: from script.util.GaussLog.GaussLog import exitWithError [as 別名]
def checkPathUsageParameter():
    """
    """
    if (g_opts.newUser == ""):
        GaussLog.exitWithError("Parameter input error, need '-u' parameter.")
    if (g_opts.configfile == ""):
        GaussLog.exitWithError("Parameter input error, need '-X' parameter.")
開發者ID:jianhuiz,項目名稱:cf-apps,代碼行數:9,代碼來源:UpgradeUtility.py

示例2: main

# 需要導入模塊: from script.util.GaussLog import GaussLog [as 別名]
# 或者: from script.util.GaussLog.GaussLog import exitWithError [as 別名]
def main():
    """
    main function
    """
    try:
        opts, args = getopt.getopt(sys.argv[1:], "U:R:i:n:l:", ["help"])
    except getopt.GetoptError, e:
        GaussLog.exitWithError("Parameter input error: " + e.msg)
開發者ID:jianhuiz,項目名稱:cf-apps,代碼行數:10,代碼來源:ReplaceConfig.py

示例3: __checkParameters

# 需要導入模塊: from script.util.GaussLog import GaussLog [as 別名]
# 或者: from script.util.GaussLog.GaussLog import exitWithError [as 別名]
 def __checkParameters(self):
     '''
     check input parameters
     '''
     try:
         opts, args = getopt.getopt(sys.argv[1:], "U:R:l:du", ["help"])
     except getopt.GetoptError, e:
         GaussLog.exitWithError("Parameter input error: " + e.msg)
開發者ID:jianhuiz,項目名稱:cf-apps,代碼行數:10,代碼來源:CheckUninstall.py

示例4: parseCommandLine

# 需要導入模塊: from script.util.GaussLog import GaussLog [as 別名]
# 或者: from script.util.GaussLog.GaussLog import exitWithError [as 別名]
def parseCommandLine():
    """
    """
    try:
        (opts, args) = getopt.getopt(sys.argv[1:], "c:p:h", ["help"])
    except Exception, e:
        usage()
        GaussLog.exitWithError(str(e))
開發者ID:jianhuiz,項目名稱:cf-apps,代碼行數:10,代碼來源:ClusterCall.py

示例5: main

# 需要導入模塊: from script.util.GaussLog import GaussLog [as 別名]
# 或者: from script.util.GaussLog.GaussLog import exitWithError [as 別名]
def main():
    """
    main function
    """
    try:
        opts, args = getopt.getopt(sys.argv[1:], "U:P:l:pbh", ["position=", "parameter", "binary_file", "logpath=", "help"])
    except getopt.GetoptError, e:
        GaussLog.exitWithError("Parameter input error: " + e.msg)
開發者ID:jianhuiz,項目名稱:cf-apps,代碼行數:10,代碼來源:Backup.py

示例6: parseCommandLine

# 需要導入模塊: from script.util.GaussLog import GaussLog [as 別名]
# 或者: from script.util.GaussLog.GaussLog import exitWithError [as 別名]
def parseCommandLine():
    """
    Parse command line and save to global variables
    """
    try:
        opts, args = getopt.getopt(sys.argv[1:], "t:u:U:X:l:", ["password_policy_value=", "support_extended_features=", "help"])
    except Exception, e:
        usage()
        GaussLog.exitWithError("Error: %s" % str(e))
開發者ID:jianhuiz,項目名稱:cf-apps,代碼行數:11,代碼來源:UpgradeUtility.py

示例7: parseCommandLine

# 需要導入模塊: from script.util.GaussLog import GaussLog [as 別名]
# 或者: from script.util.GaussLog.GaussLog import exitWithError [as 別名]
def parseCommandLine():
    """
    Parse command line and save to global variable
    """
    try:
        opts, args = getopt.getopt(sys.argv[1:], "u:U:l:", ["help"])
    except Exception, e:
        usage()
        GaussLog.exitWithError("Error: %s" % str(e))
開發者ID:jianhuiz,項目名稱:cf-apps,代碼行數:11,代碼來源:upgradePhase1Cmd_530To1130.py

示例8: parseCommandLine

# 需要導入模塊: from script.util.GaussLog import GaussLog [as 別名]
# 或者: from script.util.GaussLog.GaussLog import exitWithError [as 別名]
def parseCommandLine():
    """
    Parse command line
    """
    try:
        (opts, args) = getopt.getopt(sys.argv[1:], "U:l:O?", ["help"])
    except Exception, e:
        usage()
        GaussLog.exitWithError("Error: %s" % str(e))
開發者ID:jianhuiz,項目名稱:cf-apps,代碼行數:11,代碼來源:CreateOsUser.py

示例9: importOldVersionModules

# 需要導入模塊: from script.util.GaussLog import GaussLog [as 別名]
# 或者: from script.util.GaussLog.GaussLog import exitWithError [as 別名]
def importOldVersionModules():
    """
    import some needed modules from the old cluster.
    currently needed are: DbClusterInfo
    """
    installDir = DefaultValue.getInstallDir(g_opts.oldUser)
    if(installDir == ""):
        GaussLog.exitWithError("get install of user %s failed." % g_opts.oldUser)
        
    global g_oldVersionModules
    g_oldVersionModules = OldVersionModules()
    sys.path.append("%s/bin/script/util" % installDir)
    g_oldVersionModules.oldDbClusterInfoModule = __import__('DbClusterInfo')
開發者ID:jianhuiz,項目名稱:cf-apps,代碼行數:15,代碼來源:upgradePhase2Cmd_530To1130.py

示例10: checkParameter

# 需要導入模塊: from script.util.GaussLog import GaussLog [as 別名]
# 或者: from script.util.GaussLog.GaussLog import exitWithError [as 別名]
def checkParameter():
    """
    check parameter for different ation
    """

    if (g_opts.action == ""):
        GaussLog.exitWithError("Parameter input error, need '-t' parameter.")

    if (g_opts.logFile == ""):
        g_opts.logFile = DefaultValue.getOMLogPath(DefaultValue.DEFAULT_LOG_FILE, g_opts.user, "")

    if (g_opts.user == ""):
        GaussLog.exitWithError("Parameter input error, need '-u' parameter.")
開發者ID:jianhuiz,項目名稱:cf-apps,代碼行數:15,代碼來源:UnPreInstallUtility.py

示例11: main

# 需要導入模塊: from script.util.GaussLog import GaussLog [as 別名]
# 或者: from script.util.GaussLog.GaussLog import exitWithError [as 別名]
def main():
    """
    main function
    """
    if os.getgid() == 0:
        GaussLog.exitWithError("Can not use root privilege user run this script")

    # parse cmd lines
    parseCommandLine()

    # init globals
    initGlobal()

    # execute command
    executeCommand()

    sys.exit(0)
開發者ID:jianhuiz,項目名稱:cf-apps,代碼行數:19,代碼來源:ClusterCall.py

示例12: initGlobal

# 需要導入模塊: from script.util.GaussLog import GaussLog [as 別名]
# 或者: from script.util.GaussLog.GaussLog import exitWithError [as 別名]
def initGlobal():
    """
    Init logger
    """
    global g_clusterInfo
    global g_sshTool
    global g_user

    try:
        cmd = "id -un"
        (status, output) = commands.getstatusoutput(cmd)
        if status != 0:
            GaussLog.exitWithError("Get user info failed")
        g_user = output
        g_clusterInfo = dbClusterInfo()
        g_clusterInfo.initFromStaticConfig(output)
        g_sshTool = SshTool(g_clusterInfo.getClusterNodeNames())
    except Exception, e:
        GaussLog.exitWithError(str(e))
開發者ID:jianhuiz,項目名稱:cf-apps,代碼行數:21,代碼來源:ClusterCall.py

示例13: checkParameter

# 需要導入模塊: from script.util.GaussLog import GaussLog [as 別名]
# 或者: from script.util.GaussLog.GaussLog import exitWithError [as 別名]
def checkParameter():
    """
    check parameter for different ation
    """
    if (g_opts.action == ""):
        GaussLog.exitWithError("Parameter input error, need '-t' parameter.")
    if (g_opts.logFile == ""):
        g_opts.logFile = DefaultValue.getOMLogPath(DefaultValue.DEFAULT_LOG_FILE, g_opts.newUser, "")
    
    if (g_opts.action == ACTION_CLEAN_ENV):
        checkCleanEnvParameter()
    elif (g_opts.action == ACTION_CHECK_PATH_USAGE):
        checkPathUsageParameter()
    elif(g_opts.action == ACTION_START_IN_UPGRADE_MODE):
        checkStartInUpgradeModeParameter()
    elif (g_opts.action == ACTION_REPAIR_OLD_CLUSTER):
        checkRepairOldClusterParameter()
    elif (g_opts.action == ACTION_SET_GUC_PARAMETER):
        checkSetNodeGUCParameters()
    else:
        GaussLog.exitWithError("Invalid Action : %s" % g_opts.action)
開發者ID:jianhuiz,項目名稱:cf-apps,代碼行數:23,代碼來源:UpgradeUtility.py

示例14: checkSetNodeGUCParameters

# 需要導入模塊: from script.util.GaussLog import GaussLog [as 別名]
# 或者: from script.util.GaussLog.GaussLog import exitWithError [as 別名]
def checkSetNodeGUCParameters():
    """
    """
    if (g_opts.newUser == ""):
        GaussLog.exitWithError("Parameter input error, need '-u' parameter.")
        
    if (g_opts.password_policy_value == None):
        GaussLog.exitWithError("Parameter input error, need '--password_policy_value' parameter.")
    else:
        if(not g_opts.password_policy_value.isdigit()):
            GaussLog.exitWithError("Parameter input error, '--password_policy_value' parameter should be integer.")
        #should convert it to int
        g_opts.password_policy_value = int(g_opts.password_policy_value)

    if (g_opts.support_extended_features_value == None):
        GaussLog.exitWithError("Parameter input error, need '--support_extended_features' parameter.")
開發者ID:jianhuiz,項目名稱:cf-apps,代碼行數:18,代碼來源:UpgradeUtility.py

示例15: checkParameter

# 需要導入模塊: from script.util.GaussLog import GaussLog [as 別名]
# 或者: from script.util.GaussLog.GaussLog import exitWithError [as 別名]
def checkParameter():
    """
    Check parameter for create os user
    """
    if (g_opts.userInfo == ""):
        GaussLog.exitWithError("Parameter input error, need '-U' parameter.")
        
    strList = g_opts.userInfo.split(":")
    if (len(strList) != 2):
        GaussLog.exitWithError("Parameter input error: -U " + g_opts.userInfo)
    if (strList[0] == "" or strList[1] == ""):
        GaussLog.exitWithError("Parameter input error: -U " + g_opts.userInfo)
    g_opts.user = strList[0]
    g_opts.group = strList[1]
    
        
    if (g_opts.logFile == ""):
        g_opts.logFile = DefaultValue.getOMLogPath(DefaultValue.DEFAULT_LOG_FILE, g_opts.user, "")
        
    if (not os.path.isabs(g_opts.logFile)):
        GaussLog.exitWithError("Parameter input error, log path need absolute path.")
開發者ID:jianhuiz,項目名稱:cf-apps,代碼行數:23,代碼來源:CreateOsUser.py


注:本文中的script.util.GaussLog.GaussLog.exitWithError方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。