def GET(self): try: sc = SystCtrl() rslt = sc.deploy() if rslt['result'] == 'ok': return 'SUCC' else: return rslt except Exception, e: return e
def GET(self): try: sc = SystCtrl() rslt = sc.deploy() if rslt["result"] == "ok": return "SUCC" else: return rslt except Exception, e: return e
def GET(self): try: sc = SystCtrl() result = sc.deploy() print 'deploy: %s' % result """ {'result': 'ok'} """ if "result" in result.keys(): return 'SUCC' else: return result['error'] except Exception, e: print " sc.deploy executete error, " return '命令执行错误'
def GET(self): try: sc = SystCtrl() rslt = sc.stop() """ {'error':{'unavailable-c60', 'no-c60'}} {'result':True} """ # return rslt # print rslt # rslt['error'] = 'error' if "result" in rslt.keys(): return 'SUCC' else: return rslt['error'] except Exception, e: print " sc.test execute error, " return '测试命令执行错误'
def GET(self): try: sc = SystCtrl() rslt = sc.start() """ {'error':{'unavailable-c60', 'no-c60'}} {'result':True} """ # return rslt # print rslt # rslt['error'] = 'error' if "result" in rslt.keys(): return 'SUCC' else: return rslt['error'] except Exception, e: print " sc.test execute error, " return '测试命令执行错误'
from ua.common.utils import sort_dict_list from ua.common.yfs import get_service_list from ua.common.ua_conf import * import os import json import time import sys import web from web.contrib.template import render_jinja reload(sys) sys.setdefaultencoding('utf-8') rackOpt = RackOpt() nodeOpt = NodeOpt() systCtrl = SystCtrl() srvcOpt = SrvcOpt() urls = ( '/tab_ctrl_mng', 'Tab_ctrl_mng', '/field_ctrl', 'Field_ctrl', '/field_mng', 'Field_mng', '/tab_srvc', 'Tab_srvc', '/tab_rrd', 'Tab_rrd', '/tab_newnode', 'Tab_newnode',