The repo is Python 3 now, so update hacking to version 3.0 which
supports Python 3.
Fix problems found.
Update local hacking checks for new flake8.
Remove hacking and friends from lower-constraints, it's not needed
there.
Change-Id: I48fcd2521d99d0b77b976e87cc638fe5ac051315
The commit I34b12b96de3ea21beaf935ed8a9f6bae2fe0d0bc and
Ib384ae8130dcc6cbd47a837d11ca171ce02ef29e introduced the
deprecated oslo_utils.timeutils.isotime() is deprecated
as of 1.6.
The deprecation message says to use the datetime.datetime.isoformat()
instead, but the format of the string generated by isoformat isn't
the same as the format of the string generated by isotime. The string
is used in tokens and other public APIs and we can't change it
without potentially breaking clients.
So the workaround is to copy the current implementation from
oslo_utils.timeutils.isotime() to ec2api.api.ec2utils.
For more informations:
https://docs.openstack.org/oslo.utils/latest/reference/timeutils.html
Change-Id: Id62fb53264b04a7ea6ae3035a129353c5cfa040a
Closes-Bug: #1461251
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.
Since we have removed log translations completely, we should add hacking
rule to prevent future mistakes.
Change-Id: Ia7524308ef2675f8d41ac80b37dfc7e3787efd90
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.
See http://lists.openstack.org/pipermail/openstack-dev/2017-March/thread.html#113365.
Change-Id: I4418a388934ef58acb70c7f637b0236a6ccc7fe6
Closes-Bug: #1682101
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: Ib7ad61bac89e14561719434085b63cbad7e9a9be
current devstack deploys glance version '2' only.
use it.
messages in keystone's exceptions was changed.
fix unit tests that checks it.
Change-Id: I7ed1f0ff518efa374a5e3b693c5785958c77340d
security groups in default vpc only
changed check_and_create_default_vpc function to return default vpc
fix unit test of describe_security_groups
Change-Id: I50bad4a6a7152eb03599e3985a43162c81500049
check if default vpc exists, create if not,
use it in describe_vpcs function,
fix unit test
add unit tests for default vpc creation
Change-Id: I32411c55a9877854ef11e52f082496bb6656291f
fix working with strings for metadata server,
for some instance properties and for errors.
do some magic with types/encoding.
Change-Id: I2446fc48b51dd903a719aa4dbb1a5556af19e5df
Creating of an image by a running instance stops the instance. This
takes a time, and a client can resend the request due to timeout. The
resended request fails because instance is already not in appropriate
state (it's stoping, stopped, or scheduling at the moment).
Thus ec2api should make such images asynchronously. It should create a
DB item to reserve the image id, return it to a caller, and then stop
the instance and do other things. While image is asynchronously created
and no Glance image exists, ec2api should return the image in responses
for describe operation. Describe operation should return the image with
and without selective filter by the image id passed in.
Also it should consider a race when asynchronous task has not finished,
but Glance image is already created, and another client describe images.
In that case ec2api should not create a new db item, but reuse existed
one.
If the creation failed, ec2api should expose the image as failed and
allow to delete it.
Unit tests for auto_update_db and handle_unpaired_item will be added in
a separate review, because some refactoring is required for that.
Change-Id: Iba4ade5000bea4af35d97abd1e708bbbc57f372a
Currently etree is a preferred library to work with xml. lxml
implementation is used for doing that in OpenStack.
Change-Id: I93ce6d1a4e8e59c70e74aa6634cdc8bc67cc5914
Since there is no part of code which adds an db item with other project,
this backdoor is not needed.
This patch removes this argument and its proxying by util functions.
This reverts commit b51eb4f350.
Change-Id: I70b5d2e7246152ac2b1014f51f89f44862acab44
A public alien image can has id mapping only, but not a regular db item.
This leads to unexpected InvalidAMIID.NotFound error on certain
requests. An added test checks one such case.
Change-Id: Ie6fd0f877cbf4bdcf8b44cec82dc9cc8fb24918a
db_api.get_items_ids return id mappings (id-os_id pairs) for specified
filters. Currently it doesn't allow filters by ec2 ids. This reduces its
scope of usage.
Change-Id: Ib855429dc2fc650ef7ecff07c637b8d4b45a07db
Images have two kinds of device mappings attribute: virtual (mappings)
and block (block_device_mapping). The last one may be stored in two
different formats (legacy and bdm v2). Device descriptions are merged
from this two attributes to a single list used for instance boot
operation.
We should have a function which parses and merges image device mappings
and returns the result device list of a certain format to use it in
various parts of ec2api.
This patch introduce the function which implements the requirements
above and returns device mappings in bdm v2 format.
Change-Id: I7ad8673dcb6ddba11c6e00e22aa68a35ea1ec0fd
- public ami images in DB had incorrect project id
- public aki,ari images had incorrect project id
Change-Id: I752d0f98fed150cfa7c5de792d50b091e00afae1
1 Rename to get_items_ids
2 Fix a bug of filtering
3 Add a test on it
4 Add a test on ec2utils.os_id_to_ec2_id
Change-Id: I0ae4b0d2cd937ffa810f7cea3d818a72e3fac845
At the moment we cann't completely get rid of validation of a kind of
an object ID, because common parameter validator doesn't validate
complex parameters. So this validation is still used in several cases.
Change-Id: Ibbe73a74306f2359f6554fcc8ef7bc31d356c167