Got none with improper name when querying resource provider list

Bug #1664135 reported by Eric Xie
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Invalid
Undecided
Unassigned

Bug Description

Description
===========
I created one resource provider with name that included some special symbols,
like '$', '@' at etc. Then i queried RP list with the name for filtering,
and it returned none.

Steps to reproduce
==================
* POST http://**IP**/placement/resource_classes
{
    "name": "RP_test-dks?#¥@!##"
}
* GET http://172.23.28.30/placement/resource_providers?name=RP_test-dks?#¥@!##
{
  "resource_providers": []
}

Expected result
===============
Validate 'name' when creating RP with strict rules.

Actual result
=============
Only check if string.
        "name": {
            "type": "string",
            "maxLength": 200
        },

Environment
===========
1. nova version
[root@controller nova]# git log
commit 50d402821be7476eb58ccd791c50d8ed801e85eb
Author: Matt Riedemann <email address hidden>
Date: Wed Feb 8 10:23:14 2017 -0500

    Consider startup scenario in _get_compute_nodes_in_db

2. Which hypervisor did you use?
devstack + libvirt + kvm

Tags: placement
Revision history for this message
Chris Dent (cdent) wrote :

At least as written, there appears to be no problem here: you're passing a URL without encoding the parameters. The unicode you've used in the name parameter needs to be encoded. Once done the URL will look like:

  /placement/resource_providers?name=RP_test-dks%EF%BC%9F%23%EF%BF%A5%40%EF%BC%81%23%23k

at which point the results will include the created resource provider.

Changed in nova:
status: New → Invalid
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.