render_connection.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:xr-telemetry-m2m-web 作者: cisco 项目源码 文件源码
def render_POST(self, request):
        if 'disconnect' in request.args:
            self._request_disconnection(request)
        else:
            # Save all the _inputdata, so it's the same next time
            conn_params = {x: request.args[x][0] for x in request.args.keys()}
            if request.args['secret_type'][0] == 'key':
                conn_params['secret_key'] = 'checked'
                conn_params['secret_password'] = ''
            else:
                conn_params['secret_key'] = ''
                conn_params['secret_password'] = 'checked'

            # Save both locally and across restarts
            request.sdata.conn_params = conn_params
            try:
                with open(DEFAULT_PATH, 'wb') as f:
                    pickle.dump(conn_params, f)
            except Exception as e:
                print('### failed to save defaults: ' + str(e))

            # Do the request
            self._request_connection(request)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号