Now unpack_zip_archive_in_memory always unpacks data in
folder called 'content'. To add more flexibility we add
new parameter that defines where to unpack the data.
The purpose of the func:
unpacking zip archive in Ram, without using hard drive
The func will be called from the upload hook of
both ns_package artifact and hooks_artifact.
(cherry picked from commit 6d8356b0fb)
The RequestEntityTooLarge that are thrown from
read function (common/utils.py) will include
only the limit parameter. The param that
indicated the number of blob's bytes was
we cannot be sure that we will have
the number of bytes of the user's blob.
(cherry picked from commit 4d31dd29f7)
Add 2 parameters to RequestEntityTooLarge exception:
blob_length - The size of the blob
limit - maximum number of bytes the reader should allow
(cherry picked from commit 25992053e4)
Glare prints warnings into logs when request_id is
not specified in user context. But when the service
is used outside of OpenStack it's normal behavior
and logs confuse operators.
So, it's better to remove this warning and prevent
logs clogging with such warnings.
Currently user can't activate his artifact if glare
uploads data for other artifacts in the system.
This code fixes this behavior.
(cherry picked from commit 84c31bac4c)
Currently to prevent name/version colisions we look
for artifact with the same name/version before creation.
To do this we use simple 'list' operation. Unfortunately,
if name or version contains ':', it is considered as filter_op
delimeter and Glare returns 400 for these cases.
This code fixes this and adds explicit operator 'eq:' for each
This patch adds two improvements in devstack shell script:
1. Now we use uncommented yaml file for default policies.
2. configure_auth_token_middleware function is used to setup
keystone_authtoken middleware instead of custom implementation.
This code adds unit tests for validators.
Besides, it fixes various issues in 'validators'
module, related to logging, json-schema generation,
dead code removing and many other things.
Finally, it implements a long waiting feature for
json-schema generation: now validator strings
are applied not only to basic fields, but also
to dict and list elements. This improves detalization
of artifact type schema.
This patch adds additional unit tests for updating, listing,
uploading and deleteing of artifacts.
Plus several tests were added for trusted auth middleware.
Finally some dead code was removed from the system.
Currently there is a confusion in naming, because in
different parts of the code there are names: 'fields' and
'attributes', which represent the same things.
To avoid this, new convention is suggested:
1. Entities that define artifact structure are called
'fields'. Example of fields: 'id', 'version', 'tags',
2. There are two types of fields: basic and custom. Basic
are fields from Base artifact type and each artifact
type has them. Custom ones belong to specific artifact type
Example of custom fields: 'disk_format' for images, 'package'
3. Each field has properties. Example of field properties:
sortable, nullable, required_on_activate.
This patch renames all ocasions of attributes into fields.
For backward compatibility classes and modules can be
alternatevely accessed by their previous names.
html_last_updated_fmt option is interpreted as a
byte string in python3, causing Sphinx build to break.
This patch makes it utf-8 string.
Changing Popen to .check_output because of 3 reasons:
1. check_output() will raise CalledProcessError if
the called process returns a non-zero return code.
2. For consistency with keystone  and cinder 
3. It makes the code look much better.
The i18n team has decided not to translate the logs because it seems
like it not very useful; operators prefer to have them in English so
that they can search for those strings on the internet.
Before sort parameters direction was also considered, which is wrong.
So, defaults applied even if user wanted to sort by created_at but in asc
sort=created_at:asc,created_at:desc,id:asc, but it should be just
This patch fixes it. Now default sort parameters are added only if sort
name not in the list, regardless of the direction.
For filters now it's checked that default filter not in the list.
For example: if user wanted to filter by status=neq:deleted, the same default
filter will be applied in addition anyway, i.e. there will be two equal
filters, one from user, one is default.
This patch fixes it. Now default filters only added if they are not already
in the list.