diff options
| author | 陈冠林 <[email protected]> | 2018-12-04 19:55:23 +0800 |
|---|---|---|
| committer | 陈冠林 <[email protected]> | 2018-12-04 19:55:23 +0800 |
| commit | 366cbd599734c54ca0a6f7ae6c053a47cb7a2e6e (patch) | |
| tree | eadf814978befaab26c403a0c23947a046eafe2e /command | |
| parent | b6021cd63489c1ff4424f5da2aa385659df59cec (diff) | |
增加了配置文件hub_name
Diffstat (limited to 'command')
| -rw-r--r-- | command/views.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/command/views.py b/command/views.py index 7c1a973..9889a1e 100644 --- a/command/views.py +++ b/command/views.py @@ -59,7 +59,7 @@ class Redis: # Create your views here. def command(request): # if username == "" and password = "" : - server_pwd,host,port,index=readconfig() + server_pwd,host,port,index,hub_name=readconfig() if request.method=='GET': cmd_obj=request.GET.get('cmd_obj',default='server') if cmd_obj=='server': @@ -166,7 +166,7 @@ def command(request): # command=server_cmd+' '+command_dic['password']+password+' '+command_dic['adminhub']+' '+command_dic['password']+password+' '+\ # command_dic['csv']+' '+command_dic['cmd']+' '+command server_pwd=request.GET.get('server_pwd',default=server_pwd) - hub_name=request.GET.get('hub_name',default='NewHub0') + hub_name=request.GET.get('hub_name',default=hub_name) hub_pwd=request.GET.get('hub_pwd',default='111111') hub_cmd=server_cmd+' '+command_dic['password']+server_pwd+' '+command_dic['hub']+hub_name+' '+command_dic['password']+hub_pwd+' '\ +command_dic['cmd'] @@ -289,6 +289,7 @@ def command(request): return myresponse else: command=hub_cmd+' '+command+' '+user_name + print(command) outs,rtn_code=mysubprocess(command) if(rtn_code==0): my_dict=dict() @@ -535,10 +536,11 @@ def readconfig(): myconfig=configparser.ConfigParser() myconfig.read("CGI_config.conf") server_pwd=myconfig.get("server","server_pwd") + hub_name=myconfig.get("server","hub_name") host=myconfig.get("redis","host") port=myconfig.get("redis","port") index=myconfig.get("redis","index") - return server_pwd,host,port,index + return server_pwd,host,port,index,hub_name def IpExist(host,port,candidate_ip,index): P=Redis(host,port,index) |
