Commit Graph

16 Commits

Author SHA1 Message Date
Hervé Beraud 1d3e05a6e8 Stop to use the __future__ module.
The __future__ module [1] was used in this context to ensure compatibility
between python 2 and python 3.

We previously dropped the support of python 2.7 [2] and now we only support
python 3 so we don't need to continue to use this module and the imports
listed below.

Imports commonly used and their related PEPs:
- `division` is related to PEP 238 [3]
- `print_function` is related to PEP 3105 [4]
- `unicode_literals` is related to PEP 3112 [5]
- `with_statement` is related to PEP 343 [6]
- `absolute_import` is related to PEP 328 [7]

[1] https://docs.python.org/3/library/__future__.html
[2] https://governance.openstack.org/tc/goals/selected/ussuri/drop-py27.html
[3] https://www.python.org/dev/peps/pep-0238
[4] https://www.python.org/dev/peps/pep-3105
[5] https://www.python.org/dev/peps/pep-3112
[6] https://www.python.org/dev/peps/pep-0343
[7] https://www.python.org/dev/peps/pep-0328

Change-Id: I3a0de577d7fc75eb83c143fcf595e01eca676446
2020-06-02 20:12:23 +02:00
Andrey Pavlov 1a43b6a1c3 add ssl_ca_cert option to check client cert
option ssl_ca_cert is used to check ssl certs in
input connections from clients.

Change-Id: Ifcc398d6157488cc7b9057d3946f2ada58776754
2018-01-18 14:49:08 +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
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
Johannes Grassler d38b8ba249 Inherit from correct class for WSGI server
Using oslo.service requires the WSGI server class to implement
oslo_service.service.ServiceBase. ec2api.wsgi.Server already implemented
the interface thus defined but lacked the correct parent class.

Change-Id: Iecd2721830821ef75a321fa800d2bbd85b3ce1e1
Closes-Bug: #1562860
2016-04-05 09:18:29 +02: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 108a8387c6 fix working with incorrect certificate
use 'insecure' flag from config

Change-Id: I880dffc58ab428dcd0aacf62815faeddc0321e9f
2015-11-11 12:55:43 +03:00
Andrey Pavlov f51ca94079 py34: fix iteritems/itervalues using
Change-Id: Id3e3e814448be22184270db57ff43f5f83c4d1c1
2015-09-09 17:16:09 +03:00
Feodor Tersin 7fa6d16f06 Fix H501 errors
This rule has been updated in hacking v0.10.0 to prevent usage of
self.__dict__ in formatting operations. Since global requirements
require >= v0.10.2 of hacking for Liberty, ec2api has to follow this
extended rule.

Change-Id: I9110ed47a9a38fe351c74db27bd6b4bbb8389da4
2015-09-05 08:30:46 +03:00
Feodor Tersin 990d9643e0 Remove usage of WritableLogger from oslo_log
Do not use deprecated WriteableLogger.

Apply https://review.openstack.org/#/c/179801 from Nova.

Change-Id: Ib319356aa911cbbb48050fff78e6f99548b2f31a
2015-07-03 02:41:49 +00:00
Feodor Tersin f9af435712 Restart service at SIGHUP signal
Copy the implementation from Nova

Change-Id: Ie79287ab639c18cf0262fcd552926752bc23942f
2015-04-13 19:04:09 +03:00
Feodor Tersin 99e124814c Reorganize hierarchy of exception classes
Separate ancestors of ec2api internal and aws compliant exceptions.
EC2APIException - base exception class for ec2api with formatting
support
EC2MetadataException - still covers internal exception of ec2api
metadata service
EC2Exception - still covers AWS compliant exceptions
EC2xxxException - derive EC2Exception and are intended to group
exceptions by kind

Also remove unused attributes and code from base exception class.
Fix string constant style to be 'xxx' wherever it's possible.

Change-Id: I398c1e8e1816e0d4073fa5d3fdf0c0a939470399
2015-03-21 01:20:58 +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 6b23d0f106 Use excutils from oslo_utils instead of oslo incubator's one
Change-Id: I5614d0904606a30a75c4711605b65d39c52cfd36
2015-02-26 14:09:58 +03:00
Feodor Tersin bd25a18a1a Update copyright
Change-Id: I185fa28474fca0cc8666d6f59de251ce1f9683f2
2014-11-11 21:02:39 +04:00
Alexandre Levine 66826e9e5b Initial EC2-API service commit.
This code introduces standalone service which proxies its calls to
existing nova EC2-API.
All the code here except for the ec2api/api/proxy.py,
ec2api/api/ec2client.py and some util functions is taken from current
nova and unused functionality is cut of it.
The proxy.py and ec2client.py files implement the new code which
proxies incoming request (on port 8788) to original EC2 API in nova
on port 8773.
The result is transparently translated back to user.

Change-Id: I4cb84f833d7d4f0e379672710ed39562811d43e0
2014-07-18 19:33:55 -07:00