Calling processutils.execute() other than subprocess to
fix bytes-like and str issue in python3.
Closes-bug: #2029392
Change-Id: I16436aa19da2cf53951c9ad27bca14033194651a
oslo project provide jsonutils, the others project use it
this PS to update the json moudule to oslo jsonutils.
Closes-bug: #1966401
Change-Id: I9cbe9f03c32e4f42822def727aa2871d502641f4
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: I5f86837c601eb64dff3c370decd2670f2a6276b6
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
Add the new way which using smtplib for Zaqar email subscription
notification.
An example file for configure mail content and SMTP information
is added as well.
Change-Id: I4a1310b54bec38263981792ba0220ae516bea179
Implements: blueprint zaqar-email-delivery
This patch introduces more retry backoff function the delivery
retry policy into Zaqar. It will work when Zaqar failed to send
the notification to the subscriber. Users can define the retry
backoff function in the options of subscription or metadata
of queue.
Change-Id: I0bffd9249f8a0d466ecea1ac36d8adc37b742238
Implement: blueprint support-more-backoff-functions
This patch introduces the delivery retry policy into Zaqar.
It will work when the notification sent from Zaqar to the
subscriber failed.
User can define the retry policy in the options of subscription or
metadata of queue.
Change-Id: I1a74c2d5b69fb82826c303468099db34b3e41b5b
Implements: bp notification-delivery-policy
This patch is the third part of subscription confirmation feature.
Support to send email to subscriber if confirmation is needed.
Change-Id: I230f5c7fbc9d19554bbcf34ce9b2f3b14230321b
Implements: blueprint subscription-confirmation-support
Currently, Zaqar's notifier driver will be initialized without
any parameter when creating the subscription controller. As a
result, default value 'False' will be used instead of getting
the correct value from conf. This patch will fix this by getting
the option from conf.
Closes-Bug: #1655812
Change-Id: I31ac8c3d374b3ea38d035f1012571e6c49a18b87
Currently even though the 'require_confirmation' option is False,
Zaqar will send the confirmation notification anyway, which is
breaking the backward compatibility. This patch will fix it and
add a test for that.
Closes-Bug: #1633222
Change-Id: I2d6363feab90ff737684d5c1d903c2c2d7abe106
The subscription confirmation feature will contain four patches:
1. webhook with mongoDB
2. email with mongoDB
3. webhook with redis
4. email with redis
This patch is the first part of subscription confirmation feature for
webhook with MongoDB. Others will be achieved in follow patches.
This patch did:
1. Add v2/queue/<queue_name>/subscription/<subscription_id>/confirm
endpoint.
2. Add a new config option: "require_confirmation".
3. Add a new property "confirmed" to subscription resource for
MongoDB driver.
4. Add a new policy "subscription: confirm".
5. Add a new property "message type" for notification.
6. Use the pre-signed url in confirm request.
8. Re-use POST subscription to allow re-confirm.
9. Update notification for webhook subscription with mongoDB.
10. Support unsubscrib the subscription
11. Add tests for the feature.
12. Add doc and sample.
Docimpact
APIimpact
Change-Id: Id38d4a5b4f9303b12e22e2b5c248facda4c00143
Implements: blueprint subscription-confirmation-support
This adds the ability to send keystone authentified notifications using
trusts. To do so, you specify the posted URL with the "trust+" prefix,
and Zaqar will create and store a trust when subscribing to a queue, if
the trust not provided in the subscription options
It also add a capability to the webhook task to be able to send more
structured data in the notification, allowing to include the Zaqar
message in the data.
blueprint mistral-notifications
DocImpact
Change-Id: I12b9c1b34cdd220fcf1bdc2720043d4a8f75dc85
Query for all subscriptions on a given queue by taking into account the
returned marker, if any.
Change-Id: I6b03dd93cabc76d1c91041a896fbb30ac08032f1
Closes-Bug: #1590173
Currently notifications from Zaqar are very consise and simply represent
messages. Example:
{'body': 'somemessage', 'ttl': 60}
But subscribers are likely to want queue information inside
notifications, if they subscribe to multiple queues.
The only option for subscribers to know from which queue each
notification was sent is to listen on many ports, and make each port
correspond to each particular queue, but it's very inconvenient.
This patch adds queue name to each notification to make notifications
look like this:
{'body': 'somemessage', 'ttl': 60, 'queue_name': 'somequeue'}
Since we only add a new key to JSON dictionary, this patch is backward
compatible.
This patch adds new test case "test_proper_notification_data".
It also modifies "test_mailto" and "test_webhook" test cases, so they
consider undeterministic behavior of "json.dumps" function, which
often serializes dictionaries in different order, making test assertions
sometimes fail.
Closes-Bug: 1535811
Change-Id: Ied5fa24fd973043eda643e09aac1d6c0f1500892
Some tests used incorrect order assertEqual(observed, expected).
The correct order expected by testtools is
assertEqual(expected, observed).
This patch fix the issue in the modules zaqar/tests/unit/storage/
and zaqar/tests/unit/notification/ modules.
Partial-Bug: #1259292
Change-Id: Iac8987782d6a21a28a0503ea7cd4ec85622f7996
Trying to use the greenlet executor doesn't work when we don't use
taskflow, as nothing is doing the monkeypatching. Let's use threads for
now.
Closes-Bug: #1491326
Change-Id: Ic59f75a883eff1d4f0e4683f9d8ea4d943ad7aac
1. Using stevedore to load the task instance
2. Pass in messages list to task instead of single message
Change-Id: Ie8a475b8c2530bfd0fb2d39929c1611288c601fe
This skips taskflow launch when the notifier is called for a queue
without subscriber, preventing a traceback.
Change-Id: I63571a163efae523e52798fe4039f48859fa1fee
Closes-Bug: #1478841
Force serialization in notifications to be JSON instead of letting
requests go with urlencoded payload.
Change-Id: Ia9647f9c370b94c822dae1a57cfc635e137e20db
Closes-Bug: #1477111
This moves all unit tests out of the tests directory. It also fixies
notification tests which didn't run previously.
blueprint tests-refactoring
Change-Id: Ia69db76f06391f3db4a88565a589b0627bf17b85
This patch adds a notifier driver for webhook and the basic
task management code with taskflow.
DocImpact
Partially-Implements blueprint: notifications
Change-Id: I2727726cc57f03fb94184653452223f00fcf3d0c