[cli] fuel2 openstack-config list raises ValueError

Bug #1558561 reported by Alexander Saprykin
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fuel for OpenStack
Fix Released
High
Alexander Saprykin

Bug Description

fuel2 openstack-config list commands raises ValueError

[root@fuel ~]# fuel2 openstack-config list --env 1
500 Server Error: Internal Server Error (Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/nailgun/api/v1/handlers/base.py", line 169, in checked_data
    valid_data = method(data, **kwargs)
  File "/usr/lib/python2.7/site-packages/nailgun/api/v1/validators/openstack_config.py", line 135, in validate_query
    cls._convert_query_fields(data)
  File "/usr/lib/python2.7/site-packages/nailgun/api/v1/validators/openstack_config.py", line 161, in _convert_query_fields
    data[field] = int(data[field])
ValueError: invalid literal for int() with base 10: 'True'
)

Steps to reproduce:
Call the command above.

Expected results:
List of configuration records is displayed.

Reproducibility:
100%

Maciej Relewicz (rlu)
Changed in fuel:
status: New → Confirmed
Dmitry Pyzhov (dpyzhov)
tags: added: feature-openstack-config-change
Dmitry Pyzhov (dpyzhov)
tags: added: team-mixed
Changed in fuel:
status: Confirmed → In Progress
Revision history for this message
Vitalii Kulanov (vitaliy-t) wrote :

@Alexander, I guess I found the problem.
Please take a look at this code https://github.com/openstack/python-fuelclient/blob/master/fuelclient/commands/openstack_config.py#L93 . Here you should convert is_active parameter to int:

    is_active=int(not args.deleted)

Revision history for this message
Alexander Saprykin (cutwater) wrote :

Vitaliy, thank you for the comment. The problem it well known, but somehow the comment was not automatically added here.
It should be addressed by the comment https://review.openstack.org/#/c/296646/, since I made change into query processing rules, to make it more flexible.

Revision history for this message
Alexander Saprykin (cutwater) wrote :

*addressed by the commit

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

Reviewed: https://review.openstack.org/296646
Committed: https://git.openstack.org/cgit/openstack/fuel-web/commit/?id=a6ccd43311ce73285dcd4dd3448f8f3559c152f6
Submitter: Jenkins
Branch: master

commit a6ccd43311ce73285dcd4dd3448f8f3559c152f6
Author: Alexander Saprykin <email address hidden>
Date: Wed Mar 23 19:57:42 2016 +0200

    Add openstack config bulk operations for nodes

    * Configuration can be uploaded for multiple nodes in single request
      using 'node_ids' field with list of node ID values.
    * Filters for list operation now support multiple node ids separated
      by comma.
    * Configuration execute can be performed for multiple nodes at once.

    TestImpact
    Related-Bug: #1557462
    Closes-Bug: #1558561
    Change-Id: I741208e301f9b4ec48329ba63ffeed2b5697f123

Changed in fuel:
status: In Progress → Fix Committed
Revision history for this message
Alexander Saprykin (cutwater) wrote :

Reopened due to bugs in fuel client

Changed in fuel:
status: Fix Committed → In Progress
Revision history for this message
Alexander Saprykin (cutwater) wrote :

Not that bugs.

Changed in fuel:
status: In Progress → Fix Committed
Revision history for this message
Ksenia Svechnikova (kdemina) wrote :

Verify on ISO fuel-9.0-mos-376

1) Upload config fuel openstack-config -u --env 2 --file nova

2) Check openstack-config using fuel2:

[root@lab5-fuel9 ~]# fuel2 openstack-config list --env 2
+----+-----------+-------------+------------+---------+-----------+
| id | is_active | config_type | cluster_id | node_id | node_role |
+----+-----------+-------------+------------+---------+-----------+
| 1 | True | cluster | 2 | None | None |
+----+-----------+-------------+------------+---------+-----------+
[root@lab5-fuel9 ~]#

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

Remote bug watches

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