context in docker utils missing

Bug #1670306 reported by Andreas Merk
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Magnum
Fix Released
Undecided
yatin

Bug Description

magnum/magnum/common/docker_utils.py (branch: master) line 62 needs to be changed:

from:
<magnum_cert) = cert_manager.create_client_files(cluster)
to:
>magnum_cert) = cert_manager.create_client_files(cluster, context)

otherwise the periodic lookups fail with:
2017-03-06 10:52:37.967 24661 ERROR magnum.service.periodic Traceback (most recent call last):
2017-03-06 10:52:37.967 24661 ERROR magnum.service.periodic File "/usr/lib/python2.7/dist-packages/magnum/service/periodic.py", line 157, in _send_cluster_metrics
2017-03-06 10:52:37.967 24661 ERROR magnum.service.periodic monitor.pull_data()
2017-03-06 10:52:37.967 24661 ERROR magnum.service.periodic File "/usr/lib/python2.7/dist-packages/magnum/drivers/swarm_fedora_atomic_v1/monitor.py", line 44, in pull_data
2017-03-06 10:52:37.967 24661 ERROR magnum.service.periodic self.cluster) as docker:
2017-03-06 10:52:37.967 24661 ERROR magnum.service.periodic File "/usr/lib/python2.7/contextlib.py", line 17, in __enter__
2017-03-06 10:52:37.967 24661 ERROR magnum.service.periodic return self.gen.next()
2017-03-06 10:52:37.967 24661 ERROR magnum.service.periodic File "/usr/lib/python2.7/dist-packages/magnum/common/docker_utils.py", line 62, in docker_for_cluster
2017-03-06 10:52:37.967 24661 ERROR magnum.service.periodic magnum_cert) = cert_manager.create_client_files(cluster)
2017-03-06 10:52:37.967 24661 ERROR magnum.service.periodic File "/usr/lib/python2.7/dist-packages/magnum/conductor/handlers/common/cert_manager.py", line 135, in create_client_files
2017-03-06 10:52:37.967 24661 ERROR magnum.service.periodic ca_cert = get_cluster_ca_certificate(cluster, context)
2017-03-06 10:52:37.967 24661 ERROR magnum.service.periodic File "/usr/lib/python2.7/dist-packages/magnum/conductor/handlers/common/cert_manager.py", line 118, in get_cluster_ca_certificate
2017-03-06 10:52:37.967 24661 ERROR magnum.service.periodic context=context
2017-03-06 10:52:37.967 24661 ERROR magnum.service.periodic File "/usr/lib/python2.7/dist-packages/magnum/common/cert_manager/x509keypair_cert_manager.py", line 80, in get_cert
2017-03-06 10:52:37.967 24661 ERROR magnum.service.periodic x509keypair_obj = objects.X509KeyPair.get_by_uuid(context, cert_ref)
2017-03-06 10:52:37.967 24661 ERROR magnum.service.periodic File "/usr/lib/python2.7/dist-packages/oslo_versionedobjects/base.py", line 184, in wrapper
2017-03-06 10:52:37.967 24661 ERROR magnum.service.periodic result = fn(cls, context, *args, **kwargs)
2017-03-06 10:52:37.967 24661 ERROR magnum.service.periodic File "/usr/lib/python2.7/dist-packages/magnum/objects/x509keypair.py", line 98, in get_by_uuid
2017-03-06 10:52:37.967 24661 ERROR magnum.service.periodic db_x509keypair = cls.dbapi.get_x509keypair_by_uuid(context, uuid)
2017-03-06 10:52:37.967 24661 ERROR magnum.service.periodic File "/usr/lib/python2.7/dist-packages/magnum/db/sqlalchemy/api.py", line 423, in get_x509keypair_by_uuid
2017-03-06 10:52:37.967 24661 ERROR magnum.service.periodic query = self._add_tenant_filters(context, query)
2017-03-06 10:52:37.967 24661 ERROR magnum.service.periodic File "/usr/lib/python2.7/dist-packages/magnum/db/sqlalchemy/api.py", line 122, in _add_tenant_filters
2017-03-06 10:52:37.967 24661 ERROR magnum.service.periodic if context.is_admin and context.all_tenants:
2017-03-06 10:52:37.967 24661 ERROR magnum.service.periodic AttributeError: 'NoneType' object has no attribute 'is_admin'

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

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

Changed in magnum:
assignee: nobody → yatin (yatinkarel)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to magnum (stable/ocata)

Fix proposed to branch: stable/ocata
Review: https://review.openstack.org/444149

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

Reviewed: https://review.openstack.org/441887
Committed: https://git.openstack.org/cgit/openstack/magnum/commit/?id=4a5c95ae97dc97492e84154aaeeb602737e311c6
Submitter: Jenkins
Branch: master

commit 4a5c95ae97dc97492e84154aaeeb602737e311c6
Author: yatinkarel <email address hidden>
Date: Mon Mar 6 16:44:40 2017 +0530

    Pass 'context' to create_client_files method

    Change-Id: Ib45dbd4e48f840edf9497aa98ca87e0ffd89e17f
    Closes-Bug: #1670306

Changed in magnum:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to magnum (stable/ocata)

Reviewed: https://review.openstack.org/444149
Committed: https://git.openstack.org/cgit/openstack/magnum/commit/?id=9f6296e43220a7910b0547c6ac42cc5a6ae5b20c
Submitter: Jenkins
Branch: stable/ocata

commit 9f6296e43220a7910b0547c6ac42cc5a6ae5b20c
Author: yatinkarel <email address hidden>
Date: Mon Mar 6 16:44:40 2017 +0530

    Pass 'context' to create_client_files method

    Change-Id: Ib45dbd4e48f840edf9497aa98ca87e0ffd89e17f
    Closes-Bug: #1670306

tags: added: in-stable-ocata
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/magnum 4.1.1

This issue was fixed in the openstack/magnum 4.1.1 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/magnum 5.0.0

This issue was fixed in the openstack/magnum 5.0.0 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.