Commit Graph

35 Commits

Author SHA1 Message Date
Stephen Finucane af83b08216 Start generating our own key pairs
Nova API microversion 2.92 removed the ability to generate a private
key. The user or client is now responsible for generating the key pair.
Start doing that using cryptography, which is in our requirements
(unlike paramiko, which nova uses).

included:
https://review.opendev.org/c/openstack/ec2-api/+/857880
https://review.opendev.org/c/openstack/ec2-api/+/859192

Change-Id: I0032de8cd779beafbd6848a2aecbcb6455e8eada
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2022-09-25 12:57:33 +03:00
Andreas Jaeger 80bd123e50 Update hacking for Python3
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
2020-03-31 17:02:37 +02:00
jacky06 c27a8c4eae Update json module to jsonutils
oslo project provide jsonutils, and ec2api use it in many place[1],
this PS to update the remained json module to oslo jsonutils for consistency.

[1]: https://github.com/openstack/ec2-api/search?q=jsonutils&unscoped_q=jsonutils

Change-Id: I46e7cfe55bd5cfbca90177bc4a970c726872bab4
2019-09-13 02:00:39 +00:00
Andrey Pavlov 417b02df65 fix DB migration for MySQL
current version of migration API doesn't allow to
pass several commands to one execute

Depends-On: I9f1f39b30d43dc16a474febcf6549cf1901732ec
Change-Id: I0a74c87c4c782a7a26aa0e67fada994cb3e31434
2018-01-10 05:25:43 +00:00
Marcos Fermin Lobo 4c44fdd96c URL error for sqlalchemy-migrate doc
In this sqlalchemy-migrate doc[1] the URL is wrong.
We have to change it to the correct one.

[1] https://github.com/openstack/ec2-api/tree/master/ec2api/db/sqlalchemy/migrate_repo

Change-Id: I67d498142a3ea7d1f655dd0fc9df108f2265e18b
Closes-Bug: #1539008
2016-01-28 11:38:04 +01:00
Andrey Pavlov 2cc7ec92dc fix races
1) fix bug with filtering
filters were applied before unpaired items is added to result

2) fix races in default security group creation

3) add waiter for associate/disassociate address

4) fix security group classic test
it should choose default group group only from classic groups

5) fix describe_vpc_with_filters test
it can run in parallel with other test with same CIDR

6) fix networks list for instance run at subnet creation/deletion

7) fix selective decsribe by names
it should not delete valid items from db

Change-Id: Iadadefb8b4abebbb3b8efc0e536e5de30ed23dab
2015-12-15 09:22:50 +03:00
Feodor Tersin 4cd4f28870 Prevent updating os_id of db items
Updating of db item's os_id should be disabled. But a special case (None
-> smth) should be allowed.

Change-Id: I9a38c99d1a5d024ef38339e8d41eff7856cb3ebe
2015-09-09 18:13:32 +03:00
Feodor Tersin 2e40c234f8 Remove project_id from db.add_item interface
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
2015-08-13 18:46:09 +03:00
Feodor Tersin 16d9266c78 Extend db_api.get_items_ids to search by ec2 ids
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
2015-07-28 18:39:56 +03:00
yatin.kumbhare 99f3274944 Removing unsed variable
Depends-On: I29c2dd5f85dc8b0a59d9b3f0ea86ff3edf0a7953
Change-Id: I99c3eeb79ba61b52febd80964f2e4f90b8cb2f3e
2015-06-05 23:03:47 +00:00
Andrey Pavlov b51eb4f350 fix bugs with project id in DB for public objects
- public ami images in DB had incorrect project id
- public aki,ari images had incorrect project id

Change-Id: I752d0f98fed150cfa7c5de792d50b091e00afae1
2015-04-21 20:06:59 +03:00
Andrey Pavlov b7d53fe5e6 add fixes to images
1. extend modify_image_attributes
2. fix create_image
3. add reset_image_attribute
4. add images' tests

Change-Id: I0e52dbe46e0a0f3e6257365014f9b35bb4a21ad9
2015-04-21 14:52:18 +03:00
Feodor Tersin 80655cb362 Fix and rename get_item_ids
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
2015-04-13 11:09:35 +03:00
Feodor Tersin 1a983fe766 Bring more compatibility with oslo_db
Remove obsolete workaround for transaction in sqlite.
Prevent make request with empty filter (supress sqlalchemy warning).
Bonus: enable a test by fixing its lame name.

Change-Id: Ia7a68b6942c5a5fceab9868769d30db7862fc47e
2015-03-01 01:07:56 +03:00
Feodor Tersin 9e6e4f6542 Simplify usage of db_api.get_items_by_ids
Change-Id: I4053cfb5f1198dfee316e907ac64b9844199d83b
2015-03-01 00:46:25 +03:00
Jenkins d546e73253 Merge "Simplify usage of db_api.get_item_by_id" 2015-02-27 10:00:31 +00:00
Jenkins dc68a1b35e Merge "Simplify usage of ec2utils.get_db_item" 2015-02-26 23:17:44 +00:00
Feodor Tersin dcaf655611 Simplify usage of db_api.get_item_by_id
Change-Id: I7f839a2f845dfef707b9e6939b02e97e50f67927
2015-02-26 22:33:47 +03:00
Andrey Pavlov 67eae1069d follow oslo
move to oslo.db and some other oslo libraries

Change-Id: I57e4f01bd46339cdfe3ed2e4748eb1e923cea584
2015-02-26 22:04:09 +03:00
Feodor Tersin 2de2b74152 Simplify usage of ec2utils.get_db_item
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
2015-02-26 18:49:00 +03:00
Andrey Pavlov 2743aac621 Fix describing images with bdm.
Image with bdm has properties like '[{"key": null}]'
that can't be parsde by ast library. Using json library
insted.
Also json lib is faster than ast by this article -
http://stackoverflow.com/questions/9949533/python-eval-vs-ast-literal-eval-vs-json-decode

Change-Id: I0ae188233a44a2471afff2a6f8a4c6f9f043bfda
2015-02-16 00:00:31 +03:00
Feodor Tersin a45789dad9 Add unit tests on tags manipulations in DB API layer
Change-Id: I91280fa45f5aeff0e682f9ae3bce593f8b66f961
2014-12-30 03:14:19 +03:00
Feodor Tersin de0362ace8 Add unit tests on items manipulations in DB API layer
Change-Id: I6479de55c5df0d110f231f430d681a3e85547654
2014-12-30 00:06:22 +03:00
Andrey Pavlov 28756f3ad6 remove proxy to ec2
Change-Id: I7c20d19ba1d608c84fbcf9602fcd4be61e9f64ea
2014-12-26 16:05:16 +03:00
Feodor Tersin 6ec5a60023 Add tags to describe output
Change-Id: I620e3d497123513c35ebfaed94de93aed82758b8
2014-12-23 18:17:15 +04:00
Feodor Tersin 01e20e6cfa Tags implementation
Change-Id: Ifcc52758bed9f855928d56527c2a0edb4d5c113e
2014-12-22 14:56:14 +04:00
Feodor Tersin 4f8fdef22e Use image DB items for instances
Change-Id: I8d85f9fba9c5d2c034a0a1305ce8636b2511bb2b
2014-12-22 14:56:14 +04:00
alevine 8053ca77bb Added absent security groups unit tests and functionality
Change-Id: I4004c9c1b68bee707122f45016d3a7dbb4a7beec
2014-12-21 15:33:48 +04:00
Feodor Tersin daf47b16ef Extract describe images
It was necessary to:
- extend DB-layer API
- add ec2util functions to auto insert db items
- fix and improve Describer class
- use Describer class for volumes and snapshots

Change-Id: Ief0c3507fd1c7d7e3262a34cbd1d8bfa1d4a9ace
2014-12-19 09:54:26 +04:00
Feodor Tersin 03d974efc3 Extract snapshots implementation
Change-Id: Iefeda78e8703a7c22c1ff831c3d85d1409c9ea1e
2014-12-09 19:30:16 +04:00
Feodor Tersin 51c7193224 Extract volumes implementation
Change-Id: I491bafd9c06a0cee3596892eedc538a0c2ab64d4
2014-12-09 19:30:09 +04:00
Feodor Tersin 9600a97347 Start of extract Nova EC2. Store instance object in DB
Change-Id: I670e342f9367d3bc059a045f7b25f86b8f43eaf4
2014-11-15 00:06:02 +04:00
Feodor Tersin bd25a18a1a Update copyright
Change-Id: I185fa28474fca0cc8666d6f59de251ce1f9683f2
2014-11-11 21:02:39 +04:00
Feodor Tersin b094afcc06 Store identifiers in DB in EC2 form instead of numeric form
Change-Id: I52587fa9e1a2f9cd31349b070dfef0ea6cce33dd
2014-10-17 19:16:55 +04:00
alevine e0db6de2c0 Adding utils, tests for them and fixing some pep8.
Change-Id: If0e9deafb8923d76beee8f2da07e913beeb4a962
2014-08-05 17:46:53 +04:00