- bump version from 2 to 3 for cinderclient
- update aws ec2 interface for create_colume and
create_network_interface. add cilent_token param
- fix describe network interface - something was
changed in neutron ports output
- set metadata port for OVN conf file also
Change-Id: Ie3e5a5930d5a8159050ecc0900239935558dddd7
Now that we no longer support py27, we can use the standard library
unittest.mock module instead of the third party mock lib.
Change-Id: Iadefcc287b8557723a9bebc816080cf65636686b
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
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
when two clients come for functions where check_default_vpc
is present then one goes to create default vpc and other fails.
it fails because vpc with is_default flag is already in DB
but children objects (like subnets) are not yet created.
For we will lock check_default_vpc function.
Another way is to rework _create_vpc. It can create VPC
without is_default flag. And at the end it can set the flag.
First thread will pass this. And second thread will fail at flag set
operation and will revert all created object. Then second thread
can check presence of default VPC again.
This way is better cause it can work across several controllers.
Change-Id: I5586fa234257b72721e328a9fa2375a56d1553c2
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
Remove the Oslo Incubator code for timeutils in favor for the
oslo.utils functionality.
Change-Id: Idb7917b80add6aa0f492e6974b630c3a8ffce71f
Depends-On: Ieff34b88d857727e02a3918908b2719535ff4b55
This change introduces ec2api.openstack.common.timeutils that
substitutes the deprecating functions from oslo_utils. Using the
isoformat in the datetime lib will change the time format in API.
So it is better to carry this function in ec2-api. The deprecation
happens in this commit.
https://review.openstack.org/#/c/252898/
Change-Id: Id3606e7ca73ab3e7d58cfe6131984dbf0f3b7e4d
An admin may specify nova_service_type which doesn't support v2.1. Or
ec2-api can be run against Nova which doesn't support a required
microversion. ec2-api should check this and put warning to log.
This patch does that. If Nova service doesn't suport the required
microversion, ec2-api uses the last microvertions the service supports.
But do not switch to v2 or v2.1 with no microversions at all. This will
be useful for a future cases, when ec2-api uses new features with their
own microversions.
Change-Id: I1cc828b8cad908d9d029c57d514e4ce7e8f47352
Derive DbTestCase from BaseTestClass to use config fixture as a
preffered way for such things. Initialize full set of config options for
all tests.
This leaded to some reworking of db initialization in DBTestCase.
Change-Id: Ibec8406f141a74c6f42f6c9d502ced0008ae0214
This gives all tests ability to set custom config options in all derived
classes with no extra efforts.
Also this patch sets fatal_exception_format_errors to True for
BaseTestCase, which will control parameters passed in an exception for
all derived classes.
Change-Id: I5a4c52a7d18fe406b67dabda9f32759a9190597c
This function is useful everywhere in unit tests and should be used
instead of custom initialization.
Change-Id: Ie05f8c66a2e46aef181cbf04f4e9e2365b748c90
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
Important features:
- Nova client with microversion support is required.
- Nova API server may not support microversion 2.3 (not tested).
- Attaching volumes are not displayed in an instance bdm. Because Cinder
volume doesn't yet contain attachment info (which contains a device
name), and Nova instance volumes_attached doesn't contain a device name
(mountpoint). But a bdm must contain it.
Other features:
- v2.3 is requested always
- RunInstance result is formatted w/o extra v2.3 info, so it doesn't
contain rootDeviceName and other such info
- if rootDeviceName property is empty it's omitted instead of
to report fake /dev/sda1 as Nova EC2 does it. This leads to omit
rootDeviceType property in this case as well.
Also the same is done for corresponding image's properties.
- deleteOnTermination volume property is omitted for volume at all, and
for instance bdm if Nova doesn't report it. Previously this volume
property contained 'False' only.
- DescribeVolumes isn't used in DescribeInstances (as opposed to
DescribeNetworkInterfaces), because both methods require actual state
of corresponding OS objects, so we prevent duplication of OS requests.
- Not merged Nova client is used
https://review.openstack.org/#/c/152569/
Also:
- fix multi-run instances for EC2 Classic mode
- safe getting of OS instance security groups
- ec2context module alias is renamed to ec2_context, as it is in other
code
- fakes.CinderVolume is renamed to local standard OSVolume
- fakes.OSInstance it transformed to be initialized from a dictionary,
as it is for other fakes.OSXxx objects
- fix code style
Depends-On: Icf2b9739aaf87b4c9af13ad64a310081a68f776e
Change-Id: Id65ea0f56ffd889286d5ca082e1daf2643205c52