def _image_meta_to_headers(self, fields): headers = {} fields_copy = copy.deepcopy(fields) # NOTE(flaper87): Convert to str, headers # that are not instance of basestring. All # headers will be encoded later, before the # request is sent. for key, value in six.iteritems(fields_copy.pop('properties', {})): headers['x-image-meta-property-%s' % key] = utils.to_str(value) for key, value in six.iteritems(fields_copy): headers['x-image-meta-%s' % key] = utils.to_str(value) return headers
def _image_meta_to_headers(self, fields): headers = {} fields_copy = copy.deepcopy(fields) # NOTE(flaper87): Convert to str, headers # that are not instance of basestring. All # headers will be encoded later, before the # request is sent. for key, value in six.iteritems(fields_copy.pop('properties', {})): headers['x-image-meta-property-%s' % key] = utils.to_str(value) for key, value in six.iteritems(fields_copy): headers['x-image-meta-%s' % key] = utils.to_str(value) return headers
def _config_set_meta_to_headers(self, fields): headers = {} fields_copy = copy.deepcopy(fields) # NOTE(flaper87): Convert to str, headers # that are not instance of basestring. All # headers will be encoded later, before the # request is sent. for key, value in six.iteritems(fields_copy): headers['%s' % key] = utils.to_str(value) return headers
def _config_set_meta_to_headers(self, fields): headers = {} fields_copy = copy.deepcopy(fields) # NOTE(flaper87): Convert to str, headers # that are not instance of basestring. All # headers will be encoded later, before the # request is sent. for key, value in six.iteritems(fields_copy): headers['%s' % key] = utils.to_str(value) return headers