swift reporting stopped working, scout.scout() changed result format
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Landscape Client |
Fix Released
|
High
|
Bogdana Vereha | ||
landscape-client (Ubuntu) |
Fix Released
|
High
|
Andreas Hasenack |
Bug Description
This upstream commit (https:/
from: tuple of (recon url used, response body, and status)
to: tuple of (recon url used, response body, status, time start and time end)
This breaks landscape-client's swiftusage.py:
def _perform_
...
_, disk_usage, code = scout.scout(host) <----- backtraces
Here is a sample result from scout.scout():
('http://
I haven't investigated which version of python-swiftclient got this change, but right now it's in this one at least:
*** 2.5.0-0ubuntu1~
500 http://
Related branches
- Данило Шеган (community): Approve
- Adam Collard (community): Approve
-
Diff: 39 lines (+20/-1)2 files modifiedlandscape/monitor/swiftusage.py (+1/-1)
landscape/monitor/tests/test_swiftusage.py (+19/-0)
tags: | removed: kanban |
Changed in landscape-client: | |
status: | New → Confirmed |
status: | Confirmed → Triaged |
Changed in landscape-client: | |
status: | Triaged → In Progress |
assignee: | nobody → Adam Collard (adam-collard) |
milestone: | none → 16.03 |
Changed in landscape-client: | |
assignee: | Adam Collard (adam-collard) → Bogdana Vereha (bogdana) |
Changed in landscape-client: | |
status: | In Progress → Fix Committed |
Changed in landscape-client: | |
status: | Confirmed → Fix Committed |
Changed in landscape-client (Ubuntu): | |
status: | New → In Progress |
importance: | Undecided → High |
assignee: | nobody → Andreas Hasenack (ahasenack) |
Changed in landscape-client: | |
status: | Fix Committed → Fix Released |
Something else that apparently changed. The text keys and values from the scout() result are now unicode, and that breaks the client elsewhere: python2. 7/dist- packages/ twisted/ internet/ base.py" , line 1201, in mainLoop runUntilCurrent () python2. 7/dist- packages/ twisted/ internet/ base.py" , line 797, in runUntilCurrent python2. 7/dist- packages/ twisted/ internet/ defer.py" , line 382, in callback _startRunCallba cks(result) python2. 7/dist- packages/ twisted/ internet/ defer.py" , line 490, in _startRunCallbacks _runCallbacks( ) python2. 7/dist- packages/ twisted/ internet/ defer.py" , line 577, in _runCallbacks current. result, *args, **kw) python2. 7/dist- packages/ landscape/ monitor/ swiftusage. py", line 145, in _handle_usage python2. 7/dist- packages/ landscape/ accumulate. py", line 81, in __call__ timestamp, accumulated_value = self._persist. get(key, (0, 0)) python2. 7/dist- packages/ landscape/ lib/persist. py", line 385, in get get(self. root + path, default, soft, hard, weak) TypeError: can only concatenate tuple (not "unicode") to tuple
Traceback (most recent call last):
File "/usr/lib/
self.
File "/usr/lib/
f(*a, **kw)
File "/usr/lib/
self.
File "/usr/lib/
self.
--- <exception caught here> ---
File "/usr/lib/
current.result = callback(
File "/usr/lib/
timestamp, usage[key], persist_key)
File "/usr/lib/
previous_
File "/usr/lib/
return self.parent.
exceptions.
We only check for str in persist's get(): to_tuple( path) get(self. root + path, default, soft, hard, weak)
def get(self, path, default=None, soft=False, hard=False, weak=False):
if type(path) is str:
path = path_string_
return self.parent.