Commit Graph

23 Commits

Author SHA1 Message Date
Ghanshyam Mann d61398b5d9 Retire ec2-api: remove repo content
ec2-api project is retiring
- https://review.opendev.org/c/openstack/governance/+/919394/1

this commit remove the content of this project repo

Depends-On: https://review.opendev.org/c/openstack/project-config/+/919396/1
Change-Id: I671d27260e11ec0ae3488acf561bbdaa73a29a60
2024-05-10 18:10:02 -07:00
Andrey Pavlov f9e75281b4 fix UT for cinderclient
- 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
2021-09-28 19:24:15 +00:00
Takashi Kajinami eb3b4851a9 Use volume v3 API by default
Currently ec2api uses the volume v2 API by default, but v2 API was
deprecated a while ago and will be removed fron cinder shortly.
This patch ensures that ec2api uses the volume v3 API instead by
default.

Closes-Bug: #1908993
Change-Id: I280d3c009893c67d215b0c7106eec7fe2435c335
2021-01-24 23:34:37 +00:00
zhoulinhui b27e70a7da Use importlib to take place of imp module
The imp module is deprecated[1] since version 3.4, use importlib to
instead

[1]: https://docs.python.org/3/library/imp.html#imp.reload

Change-Id: I7da97be7403617e1460ae179f7e62dcfa47cdf09
2020-08-30 19:46:20 +08:00
Sean McGinnis 21c15aa680
Use unittest.mock instead of third party mock
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>
2020-04-18 12:15:29 -05:00
Andrey Pavlov 6d30c69895 use glanceclient version '2'. fix keystone error message.
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
2017-04-19 13:10:40 +03:00
Feodor Tersin 480dc02de0 Switch to Nova v2.32 API
At v2.33 new bdm field 'tag' was introduced. This field is automatically
created by snapshot operation for volume backed instance (ebs). The
result of the operation - bdm - is stored in metadata of the snapshot
image. When ec2api user requires to run an instance with this image
changing some attributes of the attached volume (e.g.
delete_on_termination), this bdm is merged with user defined parameters
and sent to Nova. As the result the new 'tag' field is sent to Nova
since v2.32.

However the used API version is v2.10, which does not support 'tag'
field. This did not lead to faults (until I56348dc2) because Nova
verified the first bdm only, but the first bdm for ebs instances was a
bdm for the image. With the noted fix this no more works.

This patch swithes ec2api to use v2.32 to get 'tag' field supported.

Change-Id: I68329bbffeeff5d460f3fca1a212ba20b35fc284
2016-12-29 15:31:43 +03:00
Andrey Pavlov 3a39d4d5f8 switch to using new versions of cinder service
cinder v1 is deprecated now. switching to v2.

Change-Id: I1a9f3de37c8a53ce99277d4c1bd83c9f24f1b9ef
2016-09-13 12:01:57 +03:00
Andrey Pavlov e25d1908e6 rework accessing keystone resources
do not use keystone_url in keystone_ec2_tokens_url definition.
configure these two urls independently.

Change-Id: I78c54c26820dfd7b52bf7cec81fa4ca0174a9eb6
2016-02-01 20:57:04 +03:00
Andrey Pavlov da6f97f291 rework certs stuff
remove ca_certs using for incoming requests
do small refactoring for keystone client using

Change-Id: I83dbb71248835cfc361eca691647deaa99023c8a
2015-11-12 11:19:06 +03:00
Andrey Pavlov f0a786dcb1 py34: use reload explicitly
Change-Id: I56cdcb284ba763d2b15fcccad79eaf42fe146445
2015-09-11 16:48:10 +03:00
Feodor Tersin f45249ef02 Remove support of old or absend OS client
Since requirements.txt requres all used OS clients to be present, it
isn't needed to workaround their absence.
Also since required novaclient version supports microversions, it isn't
needed to check microversions support of client.

Change-Id: Ie7f1ca4c0b1ca5661fd76b3fbcb4d661c68e0362
2015-09-11 13:10:41 +03:00
Feodor Tersin b1890b3ddd Remove support for usage OS clients with no session
Now this kind of client initialization is not used.

Change-Id: Id1003b8d6d1ea772f350fe750962e56dea02c787
2015-09-11 13:10:39 +03:00
Feodor Tersin 0ce917136c Use keystone service for regular context initialization
Using session is a recommended way to provide auth data to OS clients.

Change-Id: I267847b2be9938d991c4c988f65179e2303545ec
2015-09-10 09:19:43 +03:00
Feodor Tersin 62ae9997fb Use keystone session for admin context
Since that oslo_context is used in ec2api, admin context is cached
between service calls. This leads to that context auth token becomes
outdated, because it has no renewal logic. This is not a big problem for
ec2api service, because each new initialization of regular context
overwrites a previous cached context. But this is a problem for metadata
service, where is no regular context used.

Instead of disabling caching of admin contexts this patch uses the
caching in a separate thread storage. To handle token outdating Keystone
session is used.

Change-Id: I714419dc193471dde8a15715cbaeec83896809c9
2015-09-10 09:00:18 +03:00
Feodor Tersin 1ad56c01f6 Discover version of given compute service type
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
2015-09-03 17:06:01 +03:00
Feodor Tersin bf9fb8cc31 Fix gating for DevStack switched to Nova v2.1 by default
Use bdm v2 to boot ebs instance for gating

novaclient 2.27.0 has a bug with legacy bdm, and fails on instance boot
attempt. This patch uses bdm v2 instead to workaround the bug.

Change-Id: I3d856b2ba4116c19ab936db63d29413fdfbf31e0

Use 'compute' service type by default

It was a grand error to use not default service type as a service type
by default. Now DevStack provides v2.1 by 'compute' service type, does
not provide 'computev21' at all. Because that gating fails.

Change-Id: I8a68d331583ea575a5883cd2c451245a9119016b
2015-09-03 12:39:57 +03:00
Feodor Tersin cf2b10d9d5 Allow to set compute service type
Nova provides several API versions. Each version is provided on its own
endpoint. Endpoints are registered in Keystone service catalog with
different service types. Only one 'compute' service type name is
reserved for compute services. So names of other compute service types
are depended of custom deployment.

ec2-api prefers to work against v2.1 Nova API which allows to maximize
AWS compatibility. But service type provides v2.1 is unknown. It may be
not 'compute' one, as it is in DevStack. So ec2-api should allow to set
service type name to use it.

This patch adds an ability for service type to be specified. Old manner
of verification that used service type supports required API version is
inapporpriate now. So this check it's dropped, but a new one will be
added in a separate changed.

Change-Id: I59da2d7dada07d2f1b8e25ca17161b469a00fdfe
2015-08-21 16:04:33 +03:00
Feodor Tersin 9bd063da88 Remove support of outdated novaclients
Since current requirements require python-novaclient>=2.22.0, we can
feel free to do not support previous versions.

Change-Id: I88ee261a61e1e71083d087d58352e3fbd3ea4d56
2015-08-20 18:58:12 +03:00
Feodor Tersin b1429ae195 Enable debug logging for Nova, Glance, Cinder requests
Currently requests to these services are not logged with debug=True
config option by default. This makes debugging difficult.

Also set default log level for keystoneclient.auth to WARN, because it
floods logs with useless info.

Change-Id: Idfe2684b4146bb3c44159a08572e3c0eeff85f5f
2015-08-19 17:49:50 +03:00
Andrey Pavlov 0167580e6d adopt ec2 api to work with keystone v3 api
Change-Id: Idbafeff0aff9a32852ef0dbeaae5b341a7c06b61
2015-08-11 10:40:17 +03:00
Feodor Tersin 3f1554b92b Use correct mock object to mock context in test_client
Change-Id: Ic9d1814ab07383441b89ffe55b3ea1e4c2e2f50a
2015-07-24 13:40:55 +03:00
Feodor Tersin 070fe23aaf Get partial compatibility with pre Kilo Nova release
Change-Id: I8f1570c3c3fc297f0ffbfc7cacb84d8c53a0e453
2015-03-21 01:20:46 +03:00