Commit Graph

19 Commits

Author SHA1 Message Date
wangzihao a2d9f3ce50 Remove six
Remove six.moves Replace the following items with Python 3 style code.

- six.moves.range
- six.moves.xrange
- six.text_type
- six.PY2
- six.PY3
- six.moves.urllib
- six.string_types
- six.iteritems
- six.add_metaclass
- six.moves.map
- six.with_metaclass
- six.iterkeys
- six.itervalues

Change-Id: I469b49772899672c05f869c6870512fddfc6183d
2020-12-04 01:35:57 +00:00
changyufei 8524e44826 update aodh notifier when there're multiple regions
When there're multiple regions in openstack system, like 'regionOne' and
'regionTwo', aodh do not specify a region to get the endpoint of zaqar.

An endpoint url should be uniquely determined by 'service_id','interface',
'region_id'.

Closes-Bug: #1798033
Change-Id: I5b8d279d7ce08b165002422c07792f59f1e9912f
2018-10-16 07:53:53 +00:00
Yuanbin.Chen 342b8ad657 Fix conf not exist zaqar_client not define error
Change-Id: I8b2676c3745e7e1f375f24b72032e5fab4354988
Signed-off-by: Yuanbin.Chen <cybing4@gmail.com>
2018-04-09 13:45:21 +00:00
Jenkins c73eabf085 Merge "Replace the old auth_opts to the new in notifier/zaqar.py" 2017-09-22 21:17:42 +00:00
Zane Bitter cb90d3ad47 Don't allow the user to pass in a trust ID
Since Aodh uses trust IDs stored in alarm URLs unconditionally - without
checking for tenant safety - it is not safe to allow users to pass in their own
trust IDs. Forbid this and allow only trusts created by Aodh to be used. It is
highly unlikely that there is any (legitimate) use of this feature in the wild,
since allowing Aodh to create the trust is easier anyway.

Change-Id: I8fd11a7f9fe3c0ea5f9843a89686ac06713b7851
Closes-Bug: #1649333
2017-08-15 12:21:09 +02:00
yuqian 20caf1c59e Replace the old auth_opts to the new in notifier/zaqar.py
change os_username to username, change os_passwd to passwd, change os_tenant_name to project_name, change os_auth_url to auth_url

Closes-Bug: #1699468

Change-Id: Ic81d30fc90673053bb2ce7a55a491c54bcc6776d
2017-08-14 15:18:41 +08:00
Doug Hellmann a597136e8a turn on warning-is-error for doc builds
Turn on the flag in setup.cfg.

Fix some formatting issues with a couple of docstrings.

Fix some mistakes in the rst files.

Suppress warnings from Sphinx extensions that used to be suppressed by
pbr with older versions of Sphinx.

Change-Id: I549292b5e22cf8ae0f54f878793a36f2cd3b8e6c
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2017-07-14 10:06:41 -04:00
Thomas Herve 4c82f2e433 Fix Zaqar notifier doc
It had an incorrect example for the susbcriber option.

Change-Id: Icff8abc2b6fd0cc5d690c11063b7a6be2401e057
2017-06-15 16:09:29 +02:00
liyi 669dc34d79 Remove log translations.
Log messages are no longer being translated. This removes all use of
the _LE, _LI, and _LW translation markers to simplify logging and to
avoid confusion with new contributions.

See:
http://lists.openstack.org/pipermail/openstack-i18n/2016-November/002574.html
http://lists.openstack.org/pipermail/openstack-dev/2017-March/113365.html

Change-Id: I51c0f921ab5153bba7fdce02fb16145ce8e27ef7
2017-03-21 18:39:09 +08:00
Zane Bitter ef08bc2e6a Add trust+zaqar:// action
Allow Zaqar messages to be posted to a queue under the user's own tenant
by using a Keystone trust.

Change-Id: Ia9e200ecef13ba46479a155fee064d6dded08917
2016-12-13 21:51:06 -05:00
Zane Bitter b9242bf984 Refactor ZaqarAlarmNotifier and fix tests
Avoid duplicating the code for getting a Zaqar client.

Also fix the tests, where assertion failures in the FakeZaqarClient code
were being suppressed because of indiscriminate exception catching. We
now actually check that a message was sent, so if there is an error
we'll see the failure.

Change-Id: Ibbd7bcec15eead9ef2afda4e1c98b576162bfe8a
2016-12-13 21:50:09 -05:00
Zane Bitter 25b10e41dd Improve docs for ZaqarAlarmNotifier
Flesh out the documentation with details of how to use the Zaqar
notifier and what data needs to be included in the URL.

Change-Id: I90661dd0bbae41a3cc053e32b80123a0346f2432
2016-12-11 19:56:19 -05:00
Fei Long Wang 5b42d9fa85 Fix the endpoint type of zaqar notifier
Now since os-endpoint-type has been deprecated, so we need to use
'interface' to get the correct endpoint type of zaqar.

Change-Id: I9fb4d4836f1ef4e43359e9fddfe789a5e00d354c
2016-10-26 08:52:08 +13:00
Fei Long Wang de31a0d997 Support keystone v3 for Zaqar notifier
Change-Id: I8a24ea42e3eb7a53c1074721c5054090ad66cda4
2016-10-16 20:08:57 +13:00
Fei Long Wang 9ee22bc9e2 Add pre-signed support for zaqar notifier
Currently the zaqar notifer driver will create a queue per alarm
in service tenant, as a result, end user can't access the queue
from zaqar. Which makes it's hard to add a subscriber like mistral
because it needs a complex subscription options. The patch will
provide a capabability for end user let aodh forward the alarms
to user's queue instead of the queue created automatically in
service tenant. And this patch could benefit any 3rd party which
interested in the alarm information.

Change-Id: I4b843b39c8a13bd40aa2923a62ba681c81e06e9a
2016-09-15 22:30:41 +02:00
ZhiQiang Fan 9b1eea8f94 [Trivial] Use local conf instead of global conf
We have no global conf configured, when service is started, we
initialize a local object of cfg.ConfigOpt() instead of using
cfg.CONF. Acrossing whole Aodh project, there is only one place
still uses the global unconfigured conf object, that is zaqar.

This problem is not exposed early is because previously zaqar
register its options inside its module, hence it actually always
uses the default values, which is wrong but enough for test. After
patch I0f3b6b151fe71b25ed49d66f5c2bdecb11fb6f5f lands, it will
raise NoSuchOptError.

Let's fix this one, decision of global conf V.S. local conf can
be in another patch.

Change-Id: Ie05d778444f27f2dc07b4afb43c7037e66b3c331
2016-04-28 21:48:17 +08:00
ZhiQiang Fan 4b163ea5ef [Trivial] Add zaqar options to list_opts
aodh.notifier.zaqar registers options inside its own module, hence
cannot returned by list_opts, which leads to absent from
`tox -e genconfig`.

Change-Id: I0f3b6b151fe71b25ed49d66f5c2bdecb11fb6f5f
2016-04-28 03:59:57 +08:00
Pradeep Kilambi 209a1a55ad Load zaqar client outside init
Closes-bug: #1539685

Change-Id: Iad50452e750262dfb774361410507c5dcf8bbea0
2016-02-01 19:22:48 +00:00
Pradeep Kilambi 6c77dbc17e Zaqar notifier for alarms
Support for sending alarm notifications to zaqar queues.
This supports publishing and subscribing alarm notification
messages to zaqar queues.

Change-Id: If0e3105563d0aa05aa0d84abdba4eb3a2f601580
2016-01-19 18:16:11 -05:00