diff --git a/zaqar/notification/notifier.py b/zaqar/notification/notifier.py index 4c56ef8b7..a9ca4b940 100644 --- a/zaqar/notification/notifier.py +++ b/zaqar/notification/notifier.py @@ -83,8 +83,12 @@ class NotifierDriver(object): project=None, expires=None, api_version=None): # NOTE(flwang): If the confirmation feature isn't enabled, just do - # nothing. - if not self.require_confirmation: + # nothing. Here we're getting the require_confirmation from conf + # object instead of using self.require_confirmation, because the + # variable from self object really depends on the kwargs when + # initializing the NotifierDriver object. See bug 1655812 for more + # information. + if not conf.notification.require_confirmation: return key = conf.signed_url.secret_key diff --git a/zaqar/tests/unit/notification/test_notifier.py b/zaqar/tests/unit/notification/test_notifier.py index 07933ab37..d00b7ca04 100644 --- a/zaqar/tests/unit/notification/test_notifier.py +++ b/zaqar/tests/unit/notification/test_notifier.py @@ -264,6 +264,7 @@ class NotifierTest(testing.TestBase): @mock.patch('requests.post') def test_send_confirm_notification(self, mock_request): + self.conf.notification.require_confirmation = True subscription = {'id': '5760c9fb3990b42e8b7c20bd', 'subscriber': 'http://trigger_me', 'source': 'fake_queue',