ZFSSA drivers' restclient.py needs to fix PEP 476 and debug format messages

Bug #1460156 reported by Diem Tran
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Undecided
Diem Tran

Bug Description

There are 2 bugs in restclient.py of ZFSSA Cinder drivers that need to be fixed:

1. Python 2.7.9 implemented PEP 476 which causes the ZFSSA Cinder driver to fail early on with errors of the form:

2015-04-22 23:18:45.231 4327 ERROR cinder.volume.drivers.zfssa.restclient
[req-96cbec71-bf5f-465c-bddf-8feca5a76d37 - - - - -] URLError: [SSL:
CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581)

2.Line 271 has a redundant pair of parentheses that causes the following error:

 2015-05-24 19:31:29.693 DEBUG cinder.volume.drivers.zfssa.restclient [req-7e31750f-c79a-4de5-b82c-26320ab77408 None] Response data: {"pool": {"status": "online", "profile": "mirror", "errors": [], "scrub": {"errors": 0, "repaired": 0, "complete": true}, "name": "pool1", "usage": {"available": 10644184064.0, "total": 10670309376.0, "dedupratio": 100, "used": 26125312.0}, "peer": "00000000-0000-0000-0000-000000000000", "vdev": [{"state": "healthy", "type": "mirror", "children": [{"size": 5368709120.0, "state": "healthy", "chassis": "9ac7b4ea-db2f-e2c9-8df7-d1e460a01405", "type": "disk", "label": "HDD 1"}, {"size": 5368709120.0, "state": "healthy", "chassis": "9ac7b4ea-db2f-e2c9-8df7-d1e460a01405", "type": "disk", "label": "HDD 2"}]}, {"state": "healthy", "type": "mirror", "children": [{"size": 5368709120.0, "state": "healthy", "chassis": "9ac7b4ea-db2f-e2c9-8df7-d1e460a01405", "type": "disk", "label": "HDD 3"}, {"size": 5368709120.0, "state": "healthy", "chassis": "9ac7b4ea-db2f-e2c9-8df7-d1e460a01405", "type": "disk", "label": "HDD 4"}]}], "owner": "jz5", "asn": "afee6c89-1245-6975-e9c6-89abf8d854ca"}} __init__ /opt/stack/cinder/cinder/volume/drivers/zfssa/restclient.py:96
Traceback (most recent call last):
  File "/usr/lib/python2.7/logging/__init__.py", line 851, in emit
    msg = self.format(record)
  File "/usr/local/lib/python2.7/dist-packages/oslo_log/handlers.py", line 69, in format
    return logging.StreamHandler.format(self, record)
  File "/usr/lib/python2.7/logging/__init__.py", line 724, in format
    return fmt.format(record)
  File "/usr/local/lib/python2.7/dist-packages/oslo_log/formatters.py", line 235, in format
    return logging.Formatter.format(self, record)
  File "/usr/lib/python2.7/logging/__init__.py", line 464, in format
    record.message = record.getMessage()
  File "/usr/lib/python2.7/logging/__init__.py", line 328, in getMessage
    msg = msg % self.args
TypeError: not enough arguments for format string
Logged from file restclient.py, line 271

Tags: zfssa
Revision history for this message
Juan Zuluaga (juan-c-zuluaga) wrote :

Title is too generic. Can you make it more explicit?
Thanks

tags: added: zfssa
Revision history for this message
Diem Tran (diem-tran) wrote : Re: ZFSSA drivers' restclient.py needs to be enhanced to avoid 2 existing bugs

Hi Juan,

Since this bug actually tracks 2 issues, I can't really think of any more explicit title, but I'm open to any suggestions :). I've seen other drivers' maintainers filing common bugs for multiple issues with similar titles, so I think it's okay to leave it as is.

summary: - Fix bugs in ZFSSA drivers' restclient.py
+ ZFSSA drivers' restclient.py needs to be enhanced to avoid 2 existing
+ bugs
summary: - ZFSSA drivers' restclient.py needs to be enhanced to avoid 2 existing
- bugs
+ ZFSSA drivers' restclient.py needs to be fix to deal with PEP 476 and
+ debug format messages
summary: - ZFSSA drivers' restclient.py needs to be fix to deal with PEP 476 and
+ ZFSSA drivers' restclient.py needs to be fixed to deal with PEP 476 and
debug format messages
summary: - ZFSSA drivers' restclient.py needs to be fixed to deal with PEP 476 and
- debug format messages
+ ZFSSA drivers' restclient.py needs to fix PEP 476 and debug format
+ messages
Changed in cinder:
assignee: nobody → Diem Tran (diem-tran)
status: New → In Progress
Changed in cinder:
assignee: Diem Tran (diem-tran) → abhiram moturi (abhiram-moturi)
Changed in cinder:
assignee: abhiram moturi (abhiram-moturi) → Diem Tran (diem-tran)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.openstack.org/197736
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=814cbb8a937e2a01f2c8814dd032c0f12baa6fd4
Submitter: Jenkins
Branch: master

commit 814cbb8a937e2a01f2c8814dd032c0f12baa6fd4
Author: Diem Tran <email address hidden>
Date: Wed Jul 1 21:12:48 2015 +0000

    Fix PEP476 & format message of Oracle ZFSSA drivers

    * Handles the PEP 476 by opting out certificate verification.
    * Fix debug format messages in restclient.py

    Change-Id: Iaf9e546f0aed6b57fe9c2bf43aa2ce003a05ddf8
    Closes-Bug: #1460156

Changed in cinder:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in cinder:
milestone: none → liberty-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in cinder:
milestone: liberty-3 → 7.0.0
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.