Policy is not initialized in designate-sink

Bug #1366764 reported by Kiall Mac Innes
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Designate
Fix Released
High
Kiall Mac Innes

Bug Description

Policy is not initialized in designate-sink, resulting in failures to any policy.enforce() call similar to:

2014-09-08 10:11:58.360 INFO designate.policy [-] Policy check failed for rule 'all_tenants' on target {}
2014-09-08 10:11:58.361 ERROR oslo.messaging.notify.dispatcher [-] Exception during message handling
2014-09-08 10:11:58.361 TRACE oslo.messaging.notify.dispatcher Traceback (most recent call last):
2014-09-08 10:11:58.361 TRACE oslo.messaging.notify.dispatcher File "/usr/local/lib/python2.7/dist-packages/oslo/messaging/notify/dispatcher.py", line 85, in _dispatch_and_handle_error
2014-09-08 10:11:58.361 TRACE oslo.messaging.notify.dispatcher return self._dispatch(incoming.ctxt, incoming.message)
2014-09-08 10:11:58.361 TRACE oslo.messaging.notify.dispatcher File "/usr/local/lib/python2.7/dist-packages/oslo/messaging/notify/dispatcher.py", line 121, in _dispatch
2014-09-08 10:11:58.361 TRACE oslo.messaging.notify.dispatcher metadata)
2014-09-08 10:11:58.361 TRACE oslo.messaging.notify.dispatcher File "/opt/stack/designate/designate/sink/service.py", line 114, in info
2014-09-08 10:11:58.361 TRACE oslo.messaging.notify.dispatcher handler.process_notification(context, event_type, payload)
2014-09-08 10:11:58.361 TRACE oslo.messaging.notify.dispatcher File "/opt/stack/designate/designate/notification_handler/nova.py", line 60, in process_notification
2014-09-08 10:11:58.361 TRACE oslo.messaging.notify.dispatcher resource_type='instance')
2014-09-08 10:11:58.361 TRACE oslo.messaging.notify.dispatcher File "/opt/stack/designate/designate/notification_handler/base.py", line 122, in _create
2014-09-08 10:11:58.361 TRACE oslo.messaging.notify.dispatcher domain = self.get_domain(cfg.CONF[self.name].domain_id)
2014-09-08 10:11:58.361 TRACE oslo.messaging.notify.dispatcher File "/opt/stack/designate/designate/notification_handler/base.py", line 80, in get_domain
2014-09-08 10:11:58.361 TRACE oslo.messaging.notify.dispatcher context = DesignateContext.get_admin_context(all_tenants=True)
2014-09-08 10:11:58.361 TRACE oslo.messaging.notify.dispatcher File "/opt/stack/designate/designate/context.py", line 104, in get_admin_context
2014-09-08 10:11:58.361 TRACE oslo.messaging.notify.dispatcher return cls(None, **kwargs)
2014-09-08 10:11:58.361 TRACE oslo.messaging.notify.dispatcher File "/opt/stack/designate/designate/context.py", line 57, in __init__
2014-09-08 10:11:58.361 TRACE oslo.messaging.notify.dispatcher self.all_tenants = all_tenants
2014-09-08 10:11:58.361 TRACE oslo.messaging.notify.dispatcher File "/opt/stack/designate/designate/context.py", line 128, in all_tenants
2014-09-08 10:11:58.361 TRACE oslo.messaging.notify.dispatcher policy.check('all_tenants', self)
2014-09-08 10:11:58.361 TRACE oslo.messaging.notify.dispatcher File "/opt/stack/designate/designate/policy.py", line 86, in check
2014-09-08 10:11:58.361 TRACE oslo.messaging.notify.dispatcher result = _ENFORCER.enforce(rule, target, creds, do_raise, exc)
2014-09-08 10:11:58.361 TRACE oslo.messaging.notify.dispatcher AttributeError: 'NoneType' object has no attribute 'e

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to designate (master)

Fix proposed to branch: master
Review: https://review.openstack.org/119735

Changed in designate:
assignee: nobody → Kiall Mac Innes (kiall)
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to designate (master)

Reviewed: https://review.openstack.org/119735
Committed: https://git.openstack.org/cgit/openstack/designate/commit/?id=00d7af06038b953515cf1890406218c6cc910f01
Submitter: Jenkins
Branch: master

commit 00d7af06038b953515cf1890406218c6cc910f01
Author: Kiall Mac Innes <email address hidden>
Date: Mon Sep 8 12:17:42 2014 +0100

    Ensure designate-sink has policy initialized

    We split the designate Service class into a base Service class,
    and a RPCService class.

    Service contains code common to every Designate service, while
    RPCService contains code for any RPC servers.

    Closes-Bug: 1366764
    Change-Id: I2410a83c9f4123b2011f4f6409aacb18f010097f

Changed in designate:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in designate:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in designate:
milestone: juno-rc1 → 2014.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.