[stats] Getting of all oswl reports into zip file failed with TypeError: sequence item 0: expected string, dict found

Bug #1435224 reported by Andrey Sledzinskiy
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fuel for OpenStack
Fix Released
High
Alexander Kislitsky

Bug Description

Steps:
1. Try to get all oswl reports
curl -XGET http://localhost:8082/api/v1/csv/all > oswl.zip

Actual - it failed to zip all reports
Traceback (most recent call last):
  File "/home/asledzinskiy/Work/fuel-stats/venv/fuel-stats/local/lib/python2.7/site-packages/werkzeug/wsgi.py", line 693, in __next__
    return self._next()
  File "/home/asledzinskiy/Work/fuel-stats/venv/fuel-stats/local/lib/python2.7/site-packages/werkzeug/wrappers.py", line 81, in _iter_encoded
    for item in iterable:
  File "./fuel_analytics/api/resources/utils/export_utils.py", line 160, in flatten_data_as_csv
    for d in itertools.chain((names,), flatten_data):
  File "./fuel_analytics/api/resources/utils/oswl_stats_to_csv.py", line 86, in get_flatten_resources
    resource_keys_paths, {resource_type: resource})
  File "./fuel_analytics/api/resources/utils/export_utils.py", line 56, in get_flatten_data
    flatten_data.append(' '.join(d))
TypeError: sequence item 0: expected string, dict found
[pid: 2063|app: 0|req: 3/3] 127.0.0.1 () {24 vars in 291 bytes} [Mon Mar 23 11:06:51 2015] GET /api/v1/csv/volume => generated 513 bytes in 22 msecs (HTTP/1.1 200) 2 headers in 112 bytes (2 switches on core 0)
-------

dump of db is attached

Revision history for this message
Andrey Sledzinskiy (asledzinskiy) wrote :
Changed in fuel:
status: New → Confirmed
Changed in fuel:
status: Confirmed → In Progress
Dmitry Pyzhov (dpyzhov)
tags: added: feature-stats
removed: stats
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to fuel-stats (master)

Reviewed: https://review.openstack.org/167645
Committed: https://git.openstack.org/cgit/stackforge/fuel-stats/commit/?id=a6fb8e227247a0493d8a3eae6dd6c993f7b60021
Submitter: Jenkins
Branch: master

commit a6fb8e227247a0493d8a3eae6dd6c993f7b60021
Author: Alexander Kislitsky <email address hidden>
Date: Wed Mar 25 18:13:52 2015 +0300

    Fix for export attachments from volume

    Volume contains list of attachments. Export of attachments into CSV as enumerated fields implemented.
    Number of enumrations is added into config as CSV_VOLUME_ATTACHMENTS_NUM parameter.
    Enumeration of keys paths implemented in export_utils.
    Volume attachment skeleton added.

    Change-Id: I63eb2217c3564457a8ff4a5396eb7e7c40a76321
    Closes-Bug: #1434086
    Closes-Bug: #1435224

Changed in fuel:
status: In Progress → Fix Committed
Changed in fuel:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

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