Warnings about CORS in latest release

Bug #1642008 reported by Jay Pipes
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
oslo.middleware
Fix Released
Undecided
ChangBo Guo(gcb)

Bug Description

When running functional tests in Nova there are now a whole slew of warnings from the latest oslo_middleware release that look like this:

Captured stderr:
~~~~~~~~~~~~~~~~
    /home/jaypipes/src/git.openstack.org/openstack/nova/.tox/functional/local/lib/python2.7/site-packages/oslo_middleware/cors.py:137: DeprecationWarning: Method 'instancemethod.set_latent()' has moved to 'instancemethod.set_defaults()': CORS.set_latent has been deprecated in favor of oslo_middleware.cors.set_defaults
      allow_methods=sanitize(self.conf.get('latent_allow_methods'))

Would be great to have those cleaned up...

Jay Pipes (jaypipes)
tags: added: low-hanging-fruit
description: updated
Changed in oslo.middleware:
assignee: nobody → Jay Pipes (jaypipes)
Changed in oslo.middleware:
assignee: Jay Pipes (jaypipes) → ChangBo Guo(gcb) (glongwave)
status: New → In Progress
Revision history for this message
ChangBo Guo(gcb) (glongwave) wrote :
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on oslo.middleware (master)

Change abandoned by ChangBo Guo(gcb) (<email address hidden>) on branch: master
Review: https://review.openstack.org/453723

Changed in oslo.middleware:
assignee: ChangBo Guo(gcb) (glongwave) → nobody
status: In Progress → Confirmed
Revision history for this message
ChangBo Guo(gcb) (glongwave) wrote :

We can remove method set_latent in oslo.middleware once we confirm 'latent_allow_headers', 'latent_expose_headers'and 'latent_allow_methods' are not used in consuming projects. see

    def __init__(self, application, *args, **kwargs):
        super(CORS, self).__init__(application, *args, **kwargs)
        # Begin constructing our configuration hash.
        self.allowed_origins = {}
        self._init_conf()

        def sanitize(csv_list):
            try:
                return [str.strip(x) for x in csv_list.split(',')]
            except Exception:
                return None

        self.set_latent(
            allow_headers=sanitize(self.conf.get('latent_allow_headers')),
            expose_headers=sanitize(self.conf.get('latent_expose_headers')),
            allow_methods=sanitize(self.conf.get('latent_allow_methods'))
        )

Changed in oslo.middleware:
assignee: nobody → ChangBo Guo(gcb) (glongwave)
status: Confirmed → In Progress
Changed in magnum:
status: New → Invalid
no longer affects: magnum
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to oslo.middleware (master)

Reviewed: https://review.openstack.org/453723
Committed: https://git.openstack.org/cgit/openstack/oslo.middleware/commit/?id=2b8db6d3989cfc478f575f661cab404163fb15e2
Submitter: Jenkins
Branch: master

commit 2b8db6d3989cfc478f575f661cab404163fb15e2
Author: ChangBo Guo(gcb) <email address hidden>
Date: Fri Jul 28 16:48:08 2017 +0800

    Remove method set_latent

    Method set_latent is deprecated in favor of method set_defaults in
    e9c3a23e845d8c53b266a3b2e4ca7fb0a5a0425a, we don't use this method
    in any project, it's safe to remove it now.

    Closes-Bug: #1659051
    Closes-Bug: #1642008

    Change-Id: Ic7f0c3801f42ebafda81a1fa0b02bde6d15b545d

Changed in oslo.middleware:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/oslo.middleware 3.32.1

This issue was fixed in the openstack/oslo.middleware 3.32.1 release.

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.