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


Python GaussLog.GaussLog類代碼示例

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


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

示例1: checkPathUsageParameter

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,代碼行數:7,代碼來源:UpgradeUtility.py

示例2: parseCommandLine

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,代碼行數:8,代碼來源:ClusterCall.py

示例3: main

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,代碼行數:8,代碼來源:ReplaceConfig.py

示例4: __checkParameters

 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,代碼行數:8,代碼來源:CheckUninstall.py

示例5: main

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,代碼行數:8,代碼來源:Backup.py

示例6: parseCommandLine

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,代碼行數:9,代碼來源:UpgradeUtility.py

示例7: parseCommandLine

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,代碼行數:9,代碼來源:upgradePhase1Cmd_530To1130.py

示例8: parseCommandLine

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,代碼行數:9,代碼來源:CreateOsUser.py

示例9: importOldVersionModules

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,代碼行數:13,代碼來源:upgradePhase2Cmd_530To1130.py

示例10: checkParameter

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,代碼行數:13,代碼來源:UnPreInstallUtility.py

示例11: LocalBackup

class LocalBackup():
    '''
    classdocs
    '''   
    def __init__(self, user = "", backupDir = "", backupPara = False, backupBin = False, logFile = ""):
        '''
        Constructor
        '''
        self.backupDir = backupDir
        self.backupPara = backupPara
        self.backupBin = backupBin
        self.logFile = logFile
        
        self.installPath = ""
        self.user = user
        self.group = ""
        self.nodeInfo = None
        
        self.logger = None
        self.__hostnameFile = None
        
        ##static parameter
        self.defaultLogDir = ""
        self.logName = "gs_local_backup.log"
        self.envirName = "GAUSS_VERSION"
        self.binTarName = "binary.tar"
        self.paraTarName = "parameter.tar"
        self.hostnameFileName = "HOSTNAME"
        
    ####################################################################################
    # This is the main install flow.  
    ####################################################################################
    
    def run(self):
        '''
        check install 
        '''
        self.logger = GaussLog(self.logFile, "LocalBackup") 
        try:
            self.parseConfigFile()
            self.checkBackupDir()
            self.doBackup()
        except Exception,e:
            self.logger.closeLog()
            raise Exception(str(e))     
            
        self.logger.closeLog()
開發者ID:jianhuiz,項目名稱:cf-apps,代碼行數:47,代碼來源:Backup.py

示例12: main

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,代碼行數:17,代碼來源:ClusterCall.py

示例13: initGlobal

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,代碼行數:19,代碼來源:ClusterCall.py

示例14: checkParameter

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,代碼行數:21,代碼來源:UpgradeUtility.py

示例15: run

 def run(self):
     '''
     check install 
     '''
     self.logger = GaussLog(self.logFile, "LocalBackup") 
     try:
         self.parseConfigFile()
         self.checkBackupDir()
         self.doBackup()
     except Exception,e:
         self.logger.closeLog()
         raise Exception(str(e))     
開發者ID:jianhuiz,項目名稱:cf-apps,代碼行數:12,代碼來源:Backup.py


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