"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "cinder/volume/api.py" between
cinder-15.4.1.tar.gz and cinder-15.5.0.tar.gz

About: OpenStack Cinder (Core Service: Block Storage) provides persistent block storage to running instances. Its pluggable driver architecture facilitates the creation and management of block storage devices.
The "Train" series (maintained release).

api.py  (cinder-15.4.1):api.py  (cinder-15.5.0)
skipping to change at line 2022 skipping to change at line 2022
if not self.volume_rpcapi.thaw_host(ctxt, services[0]): if not self.volume_rpcapi.thaw_host(ctxt, services[0]):
return "Backend reported error during thaw_host operation." return "Backend reported error during thaw_host operation."
def check_volume_filters(self, filters, strict=False): def check_volume_filters(self, filters, strict=False):
"""Sets the user filter value to accepted format""" """Sets the user filter value to accepted format"""
booleans = self.db.get_booleans_for_table('volume') booleans = self.db.get_booleans_for_table('volume')
# To translate any true/false equivalent to True/False # To translate any true/false equivalent to True/False
# which is only acceptable format in database queries. # which is only acceptable format in database queries.
temp_dict = filters.copy()
for key, val in filters.items(): for key, val in temp_dict.items():
try: try:
if key in booleans: if key in booleans:
filters[key] = self._check_boolean_filter_value( filters[key] = self._check_boolean_filter_value(
key, val, strict) key, val, strict)
elif key == 'display_name': elif key == 'display_name':
# Use the raw value of display name as is for the filter # Use the raw value of display name as is for the filter
# without passing it through ast.literal_eval(). If the # without passing it through ast.literal_eval(). If the
# display name is a properly quoted string (e.g. '"foo"') # display name is a properly quoted string (e.g. '"foo"')
# then literal_eval() strips the quotes (i.e. 'foo'), so # then literal_eval() strips the quotes (i.e. 'foo'), so
# the filter becomes different from the user input. # the filter becomes different from the user input.
continue continue
else: else:
# this is required as ast.literal_eval(<int>/<float>)
# raises exception. Eg: ast.literal_eval(5) generates
# ValueError: malformed node or string: 5
if not isinstance(val, str):
val = str(val)
filters[key] = ast.literal_eval(val) filters[key] = ast.literal_eval(val)
except (ValueError, SyntaxError): except (ValueError, SyntaxError):
LOG.debug('Could not evaluate value %s, assuming string', val) LOG.debug('Could not evaluate value %s, assuming string', val)
def _check_boolean_filter_value(self, key, val, strict=False): def _check_boolean_filter_value(self, key, val, strict=False):
"""Boolean filter values in Volume GET. """Boolean filter values in Volume GET.
Before VOLUME_LIST_BOOTABLE, all values other than 'False', 'false', Before VOLUME_LIST_BOOTABLE, all values other than 'False', 'false',
'FALSE' were trated as True for specific boolean filter parameters in 'FALSE' were trated as True for specific boolean filter parameters in
Volume GET request. Volume GET request.
 End of changes. 2 change blocks. 
2 lines changed or deleted 7 lines changed or added

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