Commit Graph

37 Commits

Author SHA1 Message Date
Takashi Kajinami ce3dee3563 Bump hacking
hacking 3.0.x is too old.

Change-Id: I170c1b5e15229ab4cf043773208b3a76e3e02188
2024-01-27 22:25:42 +09:00
Takashi Kajinami cac701a531 Update python testing as per zed cycle testing runtime
In Zed cycle, we have dropped the python 3.6/3.7[1] testing
and its support. Add release notes and update the python
classifier for the same.

[1] https://governance.openstack.org/tc/reference/runtimes/zed.html

Note this change disables one unit test case consistently failing.
It should be fixed later by a separate patch.

Co-Authored-By: Ghanshyam Mann <gmann@ghanshyammann.com>
Change-Id: I6ef3bbb3f8b4aef077320478a00e096e0a57a71e
2022-06-08 15:04:29 +09:00
xuanyandong c5067f8097 Replace the following items with Python 3 style code.
- six.iteritems
- six.moves.cStringIO

Change-Id: I8236a7c6c8063c5c5d548b51a49c323ad4c14629
2020-12-01 11:19:44 +08:00
Andreas Jaeger d6b4ed4c7b Further Cleanup py27 support
This repo is now testing only with Python 3, so let's make
a few cleanups:
- Remove obsolete sections from setup.cfg
- Use newer openstackdocstheme,reno and Sphinx versions
- Remove install_command from tox.ini, the default is fine
- Use TOX_CONSTRAINTS_FILE, UPPER_CONSTRAINTS_FILE is obsolete
- Update hacking to 3.0.1, fix warnings found
- Remove babel.cfg, it's not needed anymore

Change-Id: I60edb7e44e4a8222f564f30157eb31288b85b422
2020-05-13 14:09:38 +02:00
Sean McGinnis 0b6708e986
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: I64f6f5df4d82faef205e5019be5a41c1b1f1f1fa
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2020-04-18 11:52:18 -05:00
Romain de Joux ba22defb59 Use swift.backend_path from Swift/s3api to extract account/container
Still use PATH_INFO by default if s3api not enabled and swift.backend_path
not available

Depends-On: https://review.opendev.org/#/c/718086/

Change-Id: Ibb5fc6a717b9bc938aa86c4550d156fe93dae65c
2020-04-08 22:23:52 +02:00
Romain LE DISEZ fc21cde1c2 Fix a socket leak in case of broken connection
Change-Id: I39cbbe5915ab95fb0927b0899b8f09870b4c0b07
2019-08-09 10:31:44 -04:00
zhurong edfeca139d Fix py37 test error
Change-Id: Ia36e5025d8db1568c5512263833c558c55c10f59
2019-07-09 08:08:42 +00:00
Julien Danjou fbd048f4c0 Fix default service project to "service"
Both devstack and TripleO uses "service" by default.
Nothing uses "services".

Change-Id: I6723dd0db66f57572ee53eecd89c93137e69e63b
2017-06-23 16:32:03 +02:00
Mehdi Abaakouk e2bf485044 retrieve project id to ignore from keystone
We currently allows only project uuid, but this is a pain for deployer.
Also the default is a project name which doesn't work...

This change queries keystone to retrieve project ids when the
ignore_projects list are names.

By default, if auth_type is not set, we keep the previous behavior to
not query keystone.

Change-Id: I270d080d3e65eb6b0cd823498a4dd37389c49221
2017-05-19 07:30:52 +02:00
Andrew Smith 0cea730b10 Switch to get_notification_transport for Notifier
Incorrect transport would get used when dual backends configured
for oslo.messaging

Change-Id: Ifa5dfb07b32ad753a1bdad26d2517df29e27aedc
2017-04-03 11:10:13 -04:00
gord chung d7c9cb3612 switch to topics when declaring notifier
topic kwarg is dead (for a while). long live topics.

Change-Id: Idd1eaccff9f32149a008606cad488c626dad1222
2017-02-16 21:15:32 +00:00
Julien Danjou 87bd49b62e Convert nonblocking_notify value from string to boolean
Otherwise just setting it to "False" which is a string and therefore, is
True, enables it!

Change-Id: Iaa5a25e9c7c1d33d13a244d5afe440cd5f1d9883
2016-11-07 14:08:20 -05:00
xiaozhuangqing 26bfc4859e No reason to start with '_' define a general variable
Just make code consistency,we usually use LOG to logging message rather than _LOG.
Also starting with '_' define a general variable make confused.

Change-Id: I47656e33cbc19774a0780e5b0034df0897f6afad
2016-10-11 07:15:47 +00:00
Cao Xuan Hoang 9d4c26e73f Clean imports in code
This patch set modifies lines which are importing objects
instead of modules. As per openstack import guide lines, user should
import modules in a file not objects.

http://docs.openstack.org/developer/hacking/#imports

Change-Id: Ib7f8e7e62af62ff768c1b1f065aca0a4c7db75c4
2016-09-23 15:29:38 +07:00
Jenkins a5b2377d00 Merge "Avoid useless dependency on oslo_utils" 2016-07-28 15:24:07 +00:00
Julien Danjou cf29274171 Avoid useless dependency on oslo_utils
Change-Id: Icba21e8b487c2b9a2064212ee2c550ced4be1d2e
2016-07-27 17:02:33 +02:00
Darren Hague e2e48b5d11 Fix bug in background sending
Thread's daemon property needs to be set from calling thread.
Ensure thread is alive whenever we add an event to the queue (for some reason, this is not the case for the first event when this is deployed in a swift proxy setup).

Change-Id: I9a8fad8036a0887653d2ad5f99f6b5b1b953c2db
2016-07-26 10:29:26 +01:00
Darren Hague c7cba1fe02 Add background thread notifier sending ability
Add ability to hand off notifier event sending to a queue processed by
a background thread so as not to block swift proxy. This fixes an
issue whereby if ceilometer's RabbitMQ went down then the swift proxy
would wait for it to come back up, effectively coupling Swift's
availabiilty to that of Ceilometer's RabbitMQ.
Background sending is activated by setting config item
'nonblocking_notify' to True.
Queue size defaults to 1000, which can be overridden by setting config
item 'send_queue_size'. If the queue is full, new events are discarded.

Change-Id: I3da2b88b2bc9b7fd8c572a0085fa1d78c4f54701
2016-07-11 16:37:13 +01:00
Julien Danjou 10f28d6bc8 Remove oslo.context dependency
There's no point in passing any fake context to the notifier.

Change-Id: Ib95776ecf1e3c9041b4268332cd3fb0b720b42f2
2016-05-10 12:10:12 +02:00
gordon chung 0789e5e30c use path as resource id when missing RESELLER prefix
we don't have an id if RESELLER prefix is not in path. this causes
an id to be autogenerated making each request a completely different
resource id.

this patch changes it so we just default to path as our id if one
cannot be computed.

Change-Id: I5775406a84b5f2ad0f95f366b7deca210d2f8e87
Closes-Bug: #1566940
2016-04-07 08:09:27 -04:00
Swapnil Kulkarni (coolsvap) 504a04ab93 Use assertTrue/False instead of assertEqual(T/F)
The usage of assertEqual(True/False, ***) should be changed
to a meaningful format of assertTrue/False(***).

Change-Id: I269fb387648916cc8c7b0e1e474457bd0f37395a
Closes-Bug:#1512207
2016-01-07 14:39:38 +05:30
Julien Danjou 4607f5f9d2 swift: upgrade messaging to v2
Change-Id: Ic769ca23937760d4b0120c8abf81b3d413a795f5
2015-11-06 11:37:39 +01:00
Rohit Jaiswal 7005d98f47 Ignore request with swift.source in env
swift.source in env indicates request
that originate in swift middleware as a side
effect of another client request.

These requests should not be metered, this
fix adds a check for swift.source in env
and avoids generating a metering event.

Change-Id: I2ecbde8667cc366b192a2248abc93d0936956978
Closes-bug: 1485711
2015-09-15 15:56:00 +00:00
Rohit Jaiswal 41e869a311 Fixes parsing req path for account HEAD/GET
When path is of the form /v1/AUTH_xyz, the
path parsing expects 3 tokens, this fix retries
parsing to expect 2 tokens, so that operations at
an account level can be metered.

Change-Id: I5eb83e39e7902b9410487c98295f12640aeef140
Closes-Bug: 1488682
2015-08-28 06:13:29 +00:00
Clément Contini cfb357cf51 HTTP_X_TENANT_ID is deprecated and replaced by HTTP_X_PROJECT_ID
Change-Id: I619d9db86ddcb6f3599c2d1c3c37a3628b9c7239
2015-08-14 14:10:32 -04:00
Doug Hellmann 3d6e396d8c Drop use of 'oslo' namespace package
The Oslo libraries have moved all of their code out of the 'oslo'
namespace package into per-library packages. The namespace package was
retained during kilo for backwards compatibility, but will be removed by
the liberty-2 milestone. This change removes the use of the namespace
package, replacing it with the new package names.

The patches in the libraries will be put on hold until application
patches have landed, or L2, whichever comes first. At that point, new
versions of the libraries without namespace packages will be released as
a major version update.

Please merge this patch, or an equivalent, before L2 to avoid problems
with those library releases.

Blueprint: remove-namespace-packages
https://blueprints.launchpad.net/oslo-incubator/+spec/remove-namespace-packages

Change-Id: I029c3260051aa48cfaae428c096c1ac7b43b2bd2
2015-07-16 17:46:49 +00:00
Nadya Privalova cf9cb86be7 Add test which asserts non-empty target_id
target_id should not be empty because it is used as resource_id.
Related-Bug: #1464265

Change-Id: Ibf3552c0f72f267ddd5a0a32a47427548d0b55c1
2015-06-24 18:10:41 +04:00
Jenkins 157097ef90 Merge "add support to skip event/meter generation for certain projects" 2015-06-24 09:40:58 +00:00
gordon chung 6a3c77bb30 add support to skip event/meter generation for certain projects
gnocchi is unuseable with swift backend because for every meter we
capture we are generating an event notification which creates 1+
meters, which creates 1+ event notifications, and so on. this will
flood the message queue and it will never catch up. by default, we
will configure system to ignore requests from gnocchi project.

DocImpact
Change-Id: I175c5d59529ebe51c8e5ccb379b54b05e9affe95
2015-06-23 15:45:18 +00:00
Chris Dent 60abd7b76c Set correct config choice for transport url
The code wants 'url' not 'transport_url'

Change-Id: I2f84a21cb2b1f0cc7b7c07db82559180779ed71d
2015-06-22 12:10:12 +00:00
Doug Hellmann 22681aa069 Drop use of 'oslo' namespace package
The Oslo libraries have moved all of their code out of the 'oslo'
namespace package into per-library packages. The namespace package was
retained during kilo for backwards compatibility, but will be removed by
the liberty-2 milestone. This change removes the use of the namespace
package, replacing it with the new package names.

The patches in the libraries will be put on hold until application
patches have landed, or L2, whichever comes first. At that point, new
versions of the libraries without namespace packages will be released as
a major version update.

Please merge this patch, or an equivalent, before L2 to avoid problems
with those library releases.

Blueprint: remove-namespace-packages
https://blueprints.launchpad.net/oslo-incubator/+spec/remove-namespace-packages

Change-Id: I26390dd908769be5f1a5b70be22d3b98e3a45563
2015-05-06 20:45:55 +00:00
gordon chung cb8677efff use pycadf helper module to assign action
action is a required attribute for auditing. there is an action
helper in pycadf which can compute the action value corresponding
to the HTTP method.

Change-Id: I277fd78641963644ee83df7451a3cc7699d3db15
2015-03-09 09:17:28 -04:00
gordon chung 464dbd3b23 add options to configure messaging
swift does not use oslo.config so we should allow transport
settings to be passed in via paste conf

Change-Id: I686e5d94fb72fd2a00973c91673edc417142ee2f
Closes-Bug: #1417306
2015-02-03 02:38:47 +00:00
gordon chung 468cedc34b fix py34 tests
tests should use six.iteritems to pass py34 tests. also,
encode doesn't work consistently across py2 and py3

Change-Id: I1ec858b61ec3786b139be8736a6e1fd1a47f5845
Closes-Bug: #1417303
2015-02-03 02:38:13 +00:00
gordon chung f181830a7d fix gitignore 2015-01-21 08:49:36 -05:00
gordon chung 5a5dbbbee7 initial checkin 2015-01-20 18:36:18 -05:00