Commit Graph

454 Commits

Author SHA1 Message Date
tikitavi 32740781f6 kernel_id and ramdisk_id parameters are not supported in novaclient create
remove them from ec2api

Signed-off-by: tikitavi <rtikitavi@gmail.com>
Change-Id: I0e647be2d3f1500b14deed72a64728a42a33db34
2023-06-23 14:09:56 +03:00
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
Zuul f3828311f8 Merge "Remove six" 2022-08-04 20:30:16 +00:00
nik.kaluzhin 77d6b2fc8e fixed customer_gateway
Signed-off-by: nik.kaluzhin <doupfish@gmail.com>
Change-Id: I1c9b790eb6ce3f9d4281d6b1306eed49043078f3
2022-08-03 11:35:16 +03:00
xuanyandong 44f22cf2a5 Remove six
Replace the following items with Python 3 style code.

- six.PY2
- six.text_type
- six.string_type
- six.binary_type
- six.iterkeys
- six.moves
- six.itervalues

Implements: blueprint six-removal

Change-Id: I6195ceeeed2ebe1586973eaeef7fa9f29698fec2
2022-07-05 17:37:44 +08:00
Takashi Kajinami ed85f5924c Remove ineffective codes from the FaultWrapper middleware
These three variables are initialized but unused.

Closes-Bug: #1967683
Change-Id: I5bab310fef66faa3291e7651106010761f636bc5
2022-04-04 08:07:41 +09: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
Hervé Beraud ca2bab465d Remove elementtree deprecated methods
All our supported runtimes [1] are compatible with the recommended
alternatives.

`Element.getiterator` [2] is deprecated since python 3.2 and will be removed
in python 3.9, these changes switch usages to Element.iter() [3]

[1] https://governance.openstack.org/tc/reference/runtimes/victoria.html#python-runtimes-for-train
[2] https://docs.python.org/3/library/xml.etree.elementtree.html#xml.etree.ElementTree.Element.getiterator
[3] https://docs.python.org/3/library/xml.etree.elementtree.html#xml.etree.ElementTree.Element.iter

Change-Id: Ice98ff5f59e02452c1392f3b2048929764630674
2020-06-23 11:35:58 +02: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
Dmitry_Eremeev eba6cf3805 Fix AMI image registration
Depends-On: Ibe564b0edb64eaf2240f077f4adf042689ed6057
Change-Id: I5ab6b6720ae75d9f036b41c84b11e0fe0608b0d1
2020-02-13 19:28:45 +03:00
Dmitry_Eremeev cb7cef977b Openstack API interface changed.
If rules are created or searched with full permissions (ports 1 - 65535),
they are created or found with "null" ports
instead of (ports 1 - 65535).

Depends-On: I24d1a0016f76f6813a9f62294e7eeb9785fa711b
Change-Id: Ic3fbe89720135039ba2c2afaebf3fafebac4d7e3
2020-02-11 19:06:56 +03:00
Dmitry_Eremeev 2b8bab7707 Fix encoding/decoding in paging of universal describer class
Depends-On: I43609d1b37d24d353413e906d00c62073792bb9c

Change-Id: If568ce59c5adfbc8d7a47efdb82fcfb2d427f271
2020-02-05 14:17:26 +00: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
Jake Yip 5446a54a65 Ignore floating ips not attached to instances
If floating ip is on a port attached to devices other than a nova
compute instance, (e.g. it is attached to a loadbalancer) ignore it.

Change-Id: Icda92f0f4b5246aebb082cf48bef751d9e6df2ba
2018-12-17 10:52:09 +11:00
Doug Hellmann 96756ff916 fix tox python3 overrides
We want to default to running all tox environments under python 3, so
set the basepython value in each environment.

We do not want to specify a minor version number, because we do not
want to have to update the file every time we upgrade python.

We do not want to set the override once in testenv, because that
breaks the more specific versions used in default environments like
py35 and py36.

Change-Id: Id2964291cd5e56af09f84d1aeab8138c10f9758f
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-11-12 11:02:34 +03:00
Zuul ece442f21a Merge "Added EC2 API Import Image support (via RegisterImage EC2 API call)" 2018-08-14 08:13:35 +00:00
Tyler Parcell e4ff745d0e Added EC2 API Import Image support (via RegisterImage EC2 API call)
This change allows for the EC2 API call to RegisterImage to support
external URLS provided for the "ImageLocation" parameter:
https://docs.aws.amazon.com/cli/latest/reference/ec2/register-image.html
It enforces that all standards defined there are adhered to

This changes affects RegisterImage from S3 Bucket, requiring
that the "ImageLocation" for it begin with an "s3://" (case-insensitive).

Change-Id: I2a5e93de68b1a654418781fc77369d91dd17dd48
Signed-off-by: Tyler Parcell <Parcell.Tyler@gmail.com>
2018-08-13 13:28:28 +00:00
chenghuiyu c65cb663de Fix usage of isotime
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
2018-06-29 16:00:40 +03:00
Andrey Pavlov 38b882d97d synchronize default vpc creation across threads
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
2018-03-24 00:49:01 +03:00
Andrey Pavlov 5fc752ca6f remove deprecated options
options was deprecated in previous release. remote them now

Change-Id: I524c13c59b48031b35223f81f363bc4c0862b138
2018-01-18 14:45:37 +03:00
Andrey Pavlov fce377c0ba handle new volume's status "reserved"
cinder introduced a new status 'reserved' for volume.
It means that volume has reserved for attaching.
Cause AWS doesn't know such status then we need to convert
it to status 'attaching'.

Change-Id: I84ee29eefc8a9db3982c61820e2cf72a56946132
2017-12-23 15:53:29 +00:00
Zuul 09be7d5404 Merge "remove unused configuration options" 2017-10-20 17:26:16 +00:00
tikitavi 22af51cc1c remove unused configuration options
api_rate_limit, bindir, pybasedir, service_down_time, tempdir
 was removed

Change-Id: I72389d3ea4bb0685a0862bfe765ab20b78637648
2017-10-20 13:48:00 +03:00
Gage Hugo 6e99a751b2 Correct import of keystoneauth1 session
keystoneclient.session has been long deprecated in favor of
keystoneauth1.session. This change corrects the import to use
keystoneauth1.session instead of keystoneclient.session.

Change-Id: I4a0992c5dd171975fd561d4472cb0c1d24592e8a
2017-09-13 15:59:49 -05:00
Jenkins c4f3a1e8ed Merge "Use botocore in API instead of boto" 2017-08-11 11:31:02 +00:00
Andrey Pavlov 7af41603a5 Use botocore in API instead of boto
Change-Id: Ifeda67bf4b165c5aea20a4fe413f6a0a9ca58332
2017-08-10 14:48:49 +03:00
Jenkins 5d0af87081 Merge "fix comparision of security group rules" 2017-08-04 20:27:31 +00:00
tikitavi a9dd2c38a0 fix comparision of security group rules
ignore 'tags' field when compare openstack sg rule with ec2

Change-Id: If1076c3e9d4fb84dc524450da5a9d7912f4ffbde
Depends-On: I9377e988fbdc822df46e91c0db6c8012697bc2ee
2017-08-03 09:50:31 +00:00
tikitavi 8104481c84 Remove code that used nova-cert
Change-Id: I744ca2901e2a77557ab54c2c9a37196e458a85c9
2017-07-07 11:35:22 +03:00
Jenkins 22d8fa90ad Merge "fix register_image function" 2017-07-06 10:47:32 +00:00
tikitavi 11b76a8812 fix register_image function
replacement of functions performed earlier with nova-cert service
function decrypt_text copied from novaclient to image api
certificates in devstack for uploading image to s3 are created by openssl

Change-Id: Ibf7b90ea29085656005317c4aa0fd96f3313da0c
2017-07-05 15:56:38 +03:00
Ngo Quoc Cuong 90ed02d682 Delete log translation functions and add hacking rule
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
2017-07-03 04:14:44 -04:00
tikitavi 907de91b55 turn on disable_ec2_classic in devstack installation
fix problem with incorrect creation of default vpc from metadata

Change-Id: If84c4cc1b7ec5664ff194cecb64b8f85ba4ca844
2017-06-15 14:58:52 +03:00
Jenkins b560a6b88a Merge "minor fix to https://review.openstack.org/#/c/466115/" 2017-06-05 15:00:25 +00:00
tikitavi 169db23ae6 minor fix to https://review.openstack.org/#/c/466115/
fix indents
rework unit tests

Change-Id: I65a2e749ea863023abea5e6802364c2e85ef0e38
2017-06-05 16:10:17 +03:00
Jenkins 140af4ae7b Merge "Remove log translations" 2017-05-25 14:41:17 +00:00
tikitavi 20f65fac2d fix ec2-api after deprecation of nova-network functions in novaclient
removed NovaEngine in addresses, availability_zones, instances, security_groups
removed unit tests for NovaEngine
disabled some unit tests using NovaEngine for further reworking

Closes-bug: #1691484
Change-Id: I662d5b57b9e46be80c1d2093038ada83897565eb
2017-05-24 20:00:19 +03:00
Ngo Quoc Cuong 335a0eb4ad Remove log translations
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
2017-05-11 13:43:05 +07:00
Jenkins a14bddc857 Merge "Using neutron engine in security groups describe." 2017-05-02 15:47:30 +00:00
Jenkins ceaca8338f Merge "Replace six.iteritems() with .items()" 2017-04-20 15:52:26 +00:00
M V P Nitesh 1cde1a7fe8 Replace six.iteritems() with .items()
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
2017-04-20 09:42:45 +00:00
Jake Yip 6b3c283894 Using neutron engine in security groups describe.
Nova engine works incorrect in case when describe is using in metadata.
Security-group-list in nova cannot be filtered by tenant,
listing all secgroups in case of big amount of groups can be slow
and may have limitations in number.

Co-Author: tikitavi <rtikitavi@gmail.com>

Change-Id: I199b0f4f4febad4c23a0d8968f7858763bcbf00c
Closes-Bug: #1660888
2017-04-19 12:58:44 +00: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
tikitavi 0ee47eb58e small fixes to default vpc implementation
Change-Id: I9c827ceec0ab6a2df0b221bc989a3c211c000200
2017-02-27 15:34:09 +03:00
Jenkins 5d45aea122 Merge "Changes in address in default VPC mode" 2017-02-27 08:50:05 +00:00
Jenkins a0a5dbd2df Merge "describe-security-groups by name in default VPC mode describes security groups in default vpc only" 2017-02-27 08:49:12 +00:00
Jenkins 8cd198af7d Merge "Changes in security groups in default VPC mode" 2017-02-27 08:39:41 +00:00
Jenkins 561a021d33 Merge "add instance in default-vpc by security-group-name or private-ip-address" 2017-02-27 08:38:10 +00:00
tikitavi 439adcfd08 Changes in address in default VPC mode
allocate-address without parameters allocate it in default vpc

associate and disassociate address in default vpc can be done by
public ip

release address in default vpc automatically disassociate it from
instance

add unit tests

Change-Id: I44b1aafdd6454805955871ff8076a6f6e81543ca
2017-02-22 17:23:08 +03:00
tikitavi 61daf6a80f describe-security-groups by name in default VPC mode describes
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
2017-02-19 14:16:28 +03:00