fixbug:request can't get response
Change-Id: Ib0291ba061eae3b0d57652671c02c37a2f1054d4
This commit is contained in:
parent
64b8dbc9ca
commit
e90b293138
@ -141,11 +141,11 @@ class RequestContext(context.RequestContext):
|
||||
# code.
|
||||
@property
|
||||
def project_id(self):
|
||||
return self.project_id
|
||||
return self.tenant
|
||||
|
||||
@project_id.setter
|
||||
def project_id(self, value):
|
||||
self.project_id = value
|
||||
self.tenant = value
|
||||
|
||||
@property
|
||||
def user_id(self):
|
||||
|
28
venus/modules/custom_config/action.py
Normal file
28
venus/modules/custom_config/action.py
Normal file
@ -0,0 +1,28 @@
|
||||
# Copyright 2020 Inspur
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from venus.modules.custom_config.backends.sql import CustomConfigSql
|
||||
|
||||
|
||||
class CustomConfigCore(object):
|
||||
def __init__(self):
|
||||
self.config_sql = CustomConfigSql()
|
||||
super(CustomConfigCore, self).__init__()
|
||||
|
||||
def get_config(self, id):
|
||||
res = self.config_sql.get_config(id)
|
||||
return res
|
||||
|
||||
def set_config(self, id, value):
|
||||
return self.config_sql.set_config(id, value)
|
@ -15,18 +15,19 @@
|
||||
"""The template api."""
|
||||
|
||||
from venus.api.openstack import wsgi
|
||||
from venus.conf import CONF
|
||||
from venus.modules.custom_config.action import CustomConfigCore
|
||||
|
||||
|
||||
class CustomConfigController(wsgi.Controller):
|
||||
def __init__(self, ext_mgr):
|
||||
self.ext_mgr = ext_mgr
|
||||
self.config_api = CustomConfigCore()
|
||||
super(CustomConfigController, self).__init__()
|
||||
|
||||
@wsgi.wrap_check_policy
|
||||
def get_config(self, req):
|
||||
result = dict()
|
||||
result["log_save_days"] = CONF.elasticsearch.es_index_days
|
||||
result["log_save_days"] = self.config_api.get_config("es_index_length")
|
||||
return result
|
||||
|
||||
|
||||
|
@ -303,7 +303,8 @@ def wait():
|
||||
if ("_password" in flag or "_key" in flag or
|
||||
(flag == "sql_connection" and
|
||||
("mysql:" in flag_get or "postgresql:" in flag_get))):
|
||||
LOG.debug('%s : FLAG SET ', flag)
|
||||
LOG.debug('%(flag)s : %(flag_get)s',
|
||||
{'flag': flag, 'flag_get': flag_get})
|
||||
else:
|
||||
LOG.debug('%(flag)s : %(flag_get)s',
|
||||
{'flag': flag, 'flag_get': flag_get})
|
||||
|
Loading…
x
Reference in New Issue
Block a user