"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "keystone/resource/core.py" between
keystone-16.0.1.tar.gz and keystone-17.0.0.tar.gz

About: OpenStack Keystone (Core Service: Identity) provides an authentication and authorization service for other OpenStack services. Provides a catalog of endpoints for all OpenStack services.
The "Ussuri" series (latest release).

core.py  (keystone-16.0.1):core.py  (keystone-17.0.0)
skipping to change at line 16 skipping to change at line 16
# #
# Unless required by applicable law or agreed to in writing, software # Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
"""Main entry point into the Resource service.""" """Main entry point into the Resource service."""
from oslo_log import log from oslo_log import log
import six
from keystone import assignment from keystone import assignment
from keystone.common import cache from keystone.common import cache
from keystone.common import driver_hints from keystone.common import driver_hints
from keystone.common import manager from keystone.common import manager
from keystone.common import provider_api from keystone.common import provider_api
from keystone.common.resource_options import options as ro_opt from keystone.common.resource_options import options as ro_opt
from keystone.common import utils from keystone.common import utils
import keystone.conf import keystone.conf
from keystone import exception from keystone import exception
from keystone.i18n import _ from keystone.i18n import _
from keystone import notifications from keystone import notifications
from keystone.resource.backends import base from keystone.resource.backends import base
from keystone.resource.backends import sql as resource_sql
from keystone.token import provider as token_provider from keystone.token import provider as token_provider
CONF = keystone.conf.CONF CONF = keystone.conf.CONF
LOG = log.getLogger(__name__) LOG = log.getLogger(__name__)
MEMOIZE = cache.get_memoization_decorator(group='resource') MEMOIZE = cache.get_memoization_decorator(group='resource')
PROVIDERS = provider_api.ProviderAPIs PROVIDERS = provider_api.ProviderAPIs
TAG_SEARCH_FILTERS = ('tags', 'tags-any', 'not-tags', 'not-tags-any') TAG_SEARCH_FILTERS = ('tags', 'tags-any', 'not-tags', 'not-tags-any')
class Manager(manager.Manager): class Manager(manager.Manager):
skipping to change at line 56 skipping to change at line 54
""" """
driver_namespace = 'keystone.resource' driver_namespace = 'keystone.resource'
_provides_api = 'resource_api' _provides_api = 'resource_api'
_DOMAIN = 'domain' _DOMAIN = 'domain'
_PROJECT = 'project' _PROJECT = 'project'
_PROJECT_TAG = 'project tag' _PROJECT_TAG = 'project tag'
def __init__(self): def __init__(self):
# NOTE(morgan): The resource driver must be SQL. This is because there resource_driver = CONF.resource.driver
# is a FK between identity and resource. Almost every deployment uses super(Manager, self).__init__(resource_driver)
# SQL Identity in some form. Even if SQL Identity is not used, there
# is almost no reason to have non-SQL Resource. Keystone requires
# SQL in a number of ways, this simply codifies it plainly for resource
# the driver_name = None simply implies we don't need to load a driver.
self.driver = resource_sql.Resource()
super(Manager, self).__init__(driver_name=None)
def _get_hierarchy_depth(self, parents_list): def _get_hierarchy_depth(self, parents_list):
return len(parents_list) + 1 return len(parents_list) + 1
def _assert_max_hierarchy_depth(self, project_id, parents_list=None): def _assert_max_hierarchy_depth(self, project_id, parents_list=None):
if parents_list is None: if parents_list is None:
parents_list = self.list_project_parents(project_id) parents_list = self.list_project_parents(project_id)
# NOTE(henry-nash): In upgrading to a scenario where domains are # NOTE(henry-nash): In upgrading to a scenario where domains are
# represented as projects acting as domains, we will effectively # represented as projects acting as domains, we will effectively
# increase the depth of any existing project hierarchy by one. To avoid # increase the depth of any existing project hierarchy by one. To avoid
skipping to change at line 1482 skipping to change at line 1474
# the resulting whitelisted option and raise a warning if there # the resulting whitelisted option and raise a warning if there
# appears to be an unmatched or incorrectly constructed substitution # appears to be an unmatched or incorrectly constructed substitution
# reference. To avoid the risk of logging any sensitive options that # reference. To avoid the risk of logging any sensitive options that
# have already been substituted, we first take a copy of the # have already been substituted, we first take a copy of the
# whitelisted option. # whitelisted option.
# Build a dict of the sensitive options ready to try substitution # Build a dict of the sensitive options ready to try substitution
sensitive_dict = {s['option']: s['value'] for s in sensitive} sensitive_dict = {s['option']: s['value'] for s in sensitive}
for each_whitelisted in whitelisted: for each_whitelisted in whitelisted:
if not isinstance(each_whitelisted['value'], six.string_types): if not isinstance(each_whitelisted['value'], str):
# We only support substitutions into string types, if its an # We only support substitutions into string types, if its an
# integer, list etc. then just continue onto the next one # integer, list etc. then just continue onto the next one
continue continue
# Store away the original value in case we need to raise a warning # Store away the original value in case we need to raise a warning
# after substitution. # after substitution.
original_value = each_whitelisted['value'] original_value = each_whitelisted['value']
warning_msg = '' warning_msg = ''
try: try:
each_whitelisted['value'] = ( each_whitelisted['value'] = (
 End of changes. 4 change blocks. 
11 lines changed or deleted 3 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)