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.
Change-Id: Ieb2f24776293a1890d755cddc458511b16f8eb82
The purpose of the func:
unpacking zip archive in Ram, without using hard drive
memory.
The func will be called from the upload hook of
both ns_package artifact and hooks_artifact.
Change-Id: Id4287a3f56475540f58e2728e0333612077e931a
(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
removed.
we cannot be sure that we will have
the number of bytes of the user's blob.
Change-Id: I57a586dae413519238acfd826dcb6316732f8e43
(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
Change-Id: I32bd4381f2b7b20f2fe642ffc71821872108471c
(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.
Change-Id: Ia588d5a2f067ae1333284b2def9b6612bc493cea
Currently user can't activate his artifact if glare
uploads data for other artifacts in the system.
This code fixes this behavior.
Change-Id: Ice4666b0368b86c1722651576116b08d99f6f045
Closes-bug: #1699503
(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
value.
Change-Id: I7760019cdbe1f6e8c5bf1c3b22a3cf07392aff19
Closes-bug: #1697698
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.
Closes-bug: #1697686
Change-Id: I5448486019c9ed20a4eb656d48985b5d4958848b
The purpose Secret artifact, is to enable the user to store
'secret' data such as: Private key, Certificate, Password, SSH keys Etc.
Change-Id: I89df9f7eba576a9086cdae4c4f3379caec2b8df7
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.
Change-Id: Ifee4b355bc5b9db3d597920c6aeb047cfc59c6ab
1.As mentioned in [1], we should avoid using six.iteritems to achieve
iterators. We can use dict.items instead, as it will return iterators
in PY3 as well. And dict.items/keys will more readable.
2.In py2, the performance about list should be negligible, see the
link [2].
[1] https://wiki.openstack.org/wiki/Python3
[2] http://lists.openstack.org/pipermail/openstack-dev/2015-June/066391.html
Change-Id: I9b1f1496375f5b5c6dbc5dadbb57d729680ff3fd
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.
Change-Id: Ia570d02251946b0a9c28b34678239109a125abcf
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',
'owner'.
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
only.
Example of custom fields: 'disk_format' for images, 'package'
for murano_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.
Change-Id: Iec521112020f7cb7badd010bb21be130bf5825c0
Following OpenStack Style Guidelines: [1]
Unit test assertions tend to give better messages for more
specific assertions. As a result, assertIsNone(xxx) is
preferred over assertEqual(None, xxx) and assertIs(xxx, None)
[1] http://docs.openstack.org/developer/hacking/#unit-tests-and-assertraises
Change-Id: I580dba2cc3c8ec80e080d6d0972ab342c0105943
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 [1] and cinder [2]
3. It makes the code look much better.
[1] https://review.openstack.org/#/c/457142/
[2] https://review.openstack.org/#/c/433081
Change-Id: I2da5d4cc708c06f7d03f2f2805f6340895c9f5ac
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.
Change-Id: Id9dea38dbfd15f12dd3f25a97829016a242277f4
Default sort=created_at:desc,id:asc
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
order:
sort=created_at:asc,created_at:desc,id:asc, but it should be just
sort=created_at:asc,id:asc.
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.
Change-Id: I1b23bd51d943fa2a489b948a5609fcced6ae79b1