コード例 #1
0
ファイル: viewer.py プロジェクト: lavenresearch/autoscaleNew
def run(arg):
    logger = autoscaleLog(__file__)
    sConf = staticConfig()
    infoCLocation = sConf.getInfoCLocation()
    cHelper = configHelper(infoCLocation["ipInfoC"],infoCLocation["portInfoC"])
    path = sConf.getPath()
    logFile = path+"suyiAutoscale.log"
    try:
        mode = arg.pop(0)
        print mode
        if mode == "status":
            allInfo = {}
            allInfo = getInfo.run([])
            print json.dumps(allInfo,indent=1)
            return
        elif mode == "log":
            logPath = arg.pop()
            if logPath[-1] == "/":
                logFile = logPath + "suyiAutoscale.log"
            else:
                logFile = logPath + "/suyiAutoscale.log"
            print logFile
            with open(logFile,"r") as log:
                print log.read().replace('\\n','\n').replace('\\r','\r')
                return
        else:
            print "Wrong mode"
            return
    except:
        print 'wrong arguments'
        return
コード例 #2
0
ファイル: testAll.py プロジェクト: lavenresearch/autoscaleNew
 def viewResult(self):
     getInfo.run([])
     getUsageInfo.run([])
     raw_input("press enter to continue:")