os-hosts extension's show method cannot find host which has '.' in host-name (or host name is dotted quad)

Bug #1027788 reported by Jinuk Kim
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
Vish Ishaya
Folsom
Fix Released
Low
Joe Gordon

Bug Description

How to reproduce:

1. Run nova-compute service on host on some node. (Specify host field in nova.conf as dotted quad; eg: 192.168.0.3).
2. Run nova-pythonclient (nova command) with admin credential: nova describe-resource 192.168.03
3. nova-api fails with 404 response.

nova.api.openstack.compute.contrib.hosts.HostController.show method accepts hostname as `id' argument.

If nova-pythonclient sends id as dotted quad or hostname containing '.', os-hosts/{id} fails with 404 (host not found).
It always strips last `.xx' from hostname. (processed by Routes package)

I think os-hosts extension should process '.' like os-floaing-ip-dns (as in nova.api.openstack.compute.contrib.floaing_ip_dns.py).

This bug currently affects stable branch (stable/essex) and not yet fixed in folsom development branch.

Jinuk Kim (rein)
description: updated
Changed in nova:
status: New → Triaged
importance: Undecided → Low
Revision history for this message
zhoudonshu (zhoudongshu) wrote :

I has met this problem too. and I search git log and find this patch fix this bug:
commit 8935c3bde9e9635f65522488c1aca5df5b03050d
Author: Vishvananda Ishaya <email address hidden>
Date: Wed Nov 7 23:28:28 2012 -0800

    Limit formatting routes when adding resources

    By default, routes.mapper.Mapper.resource adds a bunch of formatted
    routes that accept anything after a '.'. Our spec says only .xml
    and .json are accepted so limit the formatting to those valuse.

    This allows identifiers with a '.' in urls. A few tests were added
    to the extensions test to prove that .xml and .json are stripped
    but other values are not.

    Change-Id: Ic888aa5d75050d6b14763c2a787ac8c8d5ab1f69

Revision history for this message
Joe Gordon (jogo) wrote :

This bug still exists in Folsom, but not in master

Joe Gordon (jogo)
tags: added: folsom-backport-potential
tags: removed: folsom-backport-potential
Changed in nova:
assignee: nobody → Vish Ishaya (vishvananda)
status: Triaged → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → grizzly-2
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (stable/folsom)

Reviewed: https://review.openstack.org/19151
Committed: http://github.com/openstack/nova/commit/63fd557ec42ea59aa77a2d4aca3c4f9c301320fd
Submitter: Jenkins
Branch: stable/folsom

commit 63fd557ec42ea59aa77a2d4aca3c4f9c301320fd
Author: Vishvananda Ishaya <email address hidden>
Date: Wed Nov 7 23:28:28 2012 -0800

    Limit formatting routes when adding resources

    By default, routes.mapper.Mapper.resource adds a bunch of formatted
    routes that accept anything after a '.'. Our spec says only .xml
    and .json are accepted so limit the formatting to those valuse.

    This allows identifiers with a '.' in urls. A few tests were added
    to the extensions test to prove that .xml and .json are stripped
    but other values are not.

    Fixes bug 1027788

    Change-Id: Ic888aa5d75050d6b14763c2a787ac8c8d5ab1f69
    (cherry picked from commit 8935c3bde9e9635f65522488c1aca5df5b03050d)

Mark McLoughlin (markmc)
Changed in nova:
milestone: grizzly-2 → 2012.2.3
status: Fix Released → Fix Committed
Mark McLoughlin (markmc)
Changed in nova:
milestone: 2012.2.3 → grizzly-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: grizzly-2 → 2013.1
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.