CLI openstack-configuration filter by env-id doesn't work

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

Bug Description

Steps to reproduce:

1. Create 2 environments
2. Upload config for environment 1:
fuel openstack-config --upload --file keystone.xml --env 1

3. List configs
[root@fuel ~]# fuel openstack-config --list --env 1
id | is_active | config_type | cluster_id | node_id | node_role
---|-----------|-------------|------------|---------|----------
1 | True | cluster | 1 | None | None
[root@fuel ~]# fuel openstack-config --list --env 2
id | is_active | config_type | cluster_id | node_id | node_role
---|-----------|-------------|------------|---------|----------
1 | True | cluster | 1 | None | None

Actual result:

Configs are not filtered by env-id.

Expected result:

List command should filter configs for specified environment
and return empty list if no config exist for the specified environment.

Changed in fuel:
importance: Undecided → High
assignee: nobody → Fuel Mixed (fuel-mixed-team)
milestone: none → 8.0
Changed in fuel:
assignee: Fuel Mixed (fuel-mixed-team) → Alexander Saprykin (cutwater)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to fuel-web (master)

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

tags: added: area-python feature-openstack-config-change team-mixed
Revision history for this message
Ksenia Svechnikova (kdemina) wrote :

This filtering error could be also seen in case of deleting the only "is_active" config:

Steps:
1) Delete all configs and upload new one:
[root@nailgun ~]# fuel openstack-config --upload --env 1 --role compute --file nova_disk.yaml
Openstack configuration with id 10 has been uploaded from file 'nova_disk.yaml'

2) Check it's listed
[root@nailgun ~]# fuel openstack-config --list --env 1
id | is_active | config_type | cluster_id | node_id | node_role
---|-----------|-------------|------------|---------|----------
10 | True | role | 1 | None | compute

3) Delete it:
[root@nailgun ~]# fuel openstack-config --delete --config-id 10
Openstack configuration '10' has been deleted.

4) List all configs:
[root@nailgun ~]# fuel openstack-config --list --env 1
id | is_active | config_type | cluster_id | node_id | node_role
---|-----------|-------------|------------|---------|-----------
1 | False | role | 1 | None | controller
2 | False | role | 1 | None | controller
3 | False | role | 1 | None | controller
4 | False | role | 1 | None | compute
5 | False | role | 1 | None | controller
6 | False | role | 1 | None | compute
7 | False | role | 1 | None | controller
9 | False | role | 1 | None | compute
8 | False | role | 1 | None | controller
10 | False | role | 1 | None | compute

Here we can see all deleted configs

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

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

commit fe79f827f35ae39c97f0a06ef16d45dc51b7773a
Author: Alexander Saprykin <email address hidden>
Date: Tue Dec 8 11:50:19 2015 +0100

    Update OpenstackConfig.find_configs to return query object

    OpenstackConfig.find_configs should return query, not list
    since NalgunCollection.to_json expects iterable object and
    has incorrect behaviour when trying to pass empty list
    as an iterable parameter.

    Closes-Bug: #1523477
    Change-Id: I50aaaa9a20dbf55d83a418189f808cd3829a8002

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

Verify with ISO#277:

[root@nailgun ~]# fuel openstack-config --upload --env 1 --role compute --file nova.yaml
Openstack configuration with id 3 has been uploaded from file 'nova.yaml'
[root@nailgun ~]# fuel openstack-config --list --env 1
id | is_active | config_type | cluster_id | node_id | node_role
---|-----------|-------------|------------|---------|----------
3 | True | role | 1 | None | compute
2 | True | cluster | 1 | None | None
[root@nailgun ~]# fuel openstack-config --list --env 1 --role compute
id | is_active | config_type | cluster_id | node_id | node_role
---|-----------|-------------|------------|---------|----------
3 | True | role | 1 | None | compute
[root@nailgun ~]# fuel openstack-config --list --env 2 --role compute
id | is_active | config_type | cluster_id | node_id | node_role
---|-----------|-------------|------------|---------|----------

[root@nailgun ~]# fuel openstack-config --delete --config-id 2
Openstack configuration '2' has been deleted.
[root@nailgun ~]# fuel openstack-config --delete --config-id 3
Openstack configuration '3' has been deleted.
[root@nailgun ~]# fuel openstack-config --list --env 1
id | is_active | config_type | cluster_id | node_id | node_role
---|-----------|-------------|------------|---------|----------

[root@nailgun ~]# fuel openstack-config --upload --env 1 --file neutron.yaml
Openstack configuration with id 4 has been uploaded from file 'neutron.yaml'
[root@nailgun ~]# fuel openstack-config --list --env 1
id | is_active | config_type | cluster_id | node_id | node_role
---|-----------|-------------|------------|---------|----------
4 | True | cluster | 1 | None | None

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.