当前位置: 首页>>代码示例>>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;未经允许,请勿转载。