Bug 1217545 - Hostname field on new cloud provider page does not trim trailing whitespace
Summary: Hostname field on new cloud provider page does not trim trailing whitespace
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: UI - OPS
Version: 5.3.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: GA
: 5.5.0
Assignee: Brian McLaughlin
QA Contact: Taras Lehinevych
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-04-30 15:37 UTC by Greg Blomquist
Modified: 2015-12-08 13:06 UTC (History)
11 users (show)

Fixed In Version: 5.5.0.10
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-12-08 13:06:54 UTC
Category: ---
Cloudforms Team: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2015:2551 0 normal SHIPPED_LIVE Moderate: CFME 5.5.0 bug fixes and enhancement update 2015-12-08 17:58:09 UTC

Description Greg Blomquist 2015-04-30 15:37:29 UTC
Description of problem:

The Hostname field of the Add New Cloud Provider page does not trim trailing whitespace.

Steps to Reproduce:

1. Select Clouds -> Providers -> Configuration -> Add New Cloud Provider
2. Select "OpenStack" type
3. Enter "10.10.10.10  " into the IP adderess field.
4. Fill in the rest of the fields and save
5. Edit the newly saved cloud provider and notice that the IP address field still contains the spaces

Additional info:

Possible logged errors:

(1)
MIQ(EmsOpenstack.verify_api_credentials) Error Class=URI::InvalidComponentError, Message=bad component(expected host component): 10.10.10.10

(2)
MIQ(EmsOpenstack.verify_api_credentials) Error Class=URI::InvalidURIError, Message=bad URI(is not URI?)

Comment 1 Jason Frey 2015-05-05 17:52:27 UTC
We may want to check the case where if someone enters the trailing whitespace, saves, then goes back and edits and tries to remove it, perhaps it's not getting removed.

Comment 4 Sean Myers 2015-05-06 22:14:22 UTC
I've reproduced this on 5.3.4.2 and 5.4.0.0.24. It's worth noting the apparent disagreement between the subject and description, where the subject mentions the hostname field but the description mentions the ipaddress field. It turns out that they're both right! This is because the ipaddress field was removed in 5.4, and the hostname is used instead. So, for 5.3 "the field" is the ipaddress field, and on 5.4, "the field" is the hostname field. The field is required in the provider create/edit forms on each stream.

In either stream, if the field has trailing whitespace, credential validation fails.

I tested Jason's suggestion, and observed that removing the whitespace causes credential validation to succeed thereafter (and re-introducing the whitespace similarly re-breaks credential validation). As far as I can tell, nothing is trimming the whitespace on the field during provider creation or editing. Whatever gets put in the field is used, assuming validation succeeds.

In response to Dan's comment, I can confirm that credential validation works when entering a normal ip address, sans trailing whitespace. Adding the trailing spaces is what causes breakage.

Comment 6 CFME Bot 2015-05-15 21:11:08 UTC
New commit detected on manageiq/master:
https://github.com/ManageIQ/manageiq/commit/1a520adb4e9f5649a5562a4eaf27adb8fe3efab4

commit 1a520adb4e9f5649a5562a4eaf27adb8fe3efab4
Author:     Brian McLaughlin <bmclaugh>
AuthorDate: Thu May 14 10:26:25 2015 -0400
Commit:     Brian McLaughlin <bmclaugh>
CommitDate: Thu May 14 14:57:44 2015 -0400

    Strip whitespace from hostname on new provider and host creation
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1217545

 vmdb/app/controllers/ems_common.rb                 |  2 +-
 vmdb/app/controllers/host_controller.rb            |  2 +-
 .../spec/controllers/ems_common_controller_spec.rb | 26 ++++++++++++++++++++++
 vmdb/spec/controllers/host_controller_spec.rb      | 14 ++++++++++++
 4 files changed, 42 insertions(+), 2 deletions(-)

Comment 7 Pete Savage 2015-10-05 13:32:59 UTC
Failed verification 5.5.0.3-alpha1.2.20150929172214_2eda7b4

Comment 9 CFME Bot 2015-10-30 21:18:35 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/c3c6b9e6a2ca092fdb0356651b010b91ab5b0d19

commit c3c6b9e6a2ca092fdb0356651b010b91ab5b0d19
Author:     Brian McLaughlin <bmclaugh>
AuthorDate: Thu Oct 29 10:36:30 2015 -0400
Commit:     Brian McLaughlin <bmclaugh>
CommitDate: Fri Oct 30 14:38:38 2015 -0400

    Validate whitespace is removed from hostname field on Cloud Providers
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1217545

 spec/controllers/ems_cloud_controller_spec.rb | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

Comment 10 CFME Bot 2015-10-30 21:18:42 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/902d9cf4de47fb2980219bf948daac76489b9090

commit 902d9cf4de47fb2980219bf948daac76489b9090
Author:     Brian McLaughlin <bmclaugh>
AuthorDate: Thu Oct 29 10:41:10 2015 -0400
Commit:     Brian McLaughlin <bmclaugh>
CommitDate: Fri Oct 30 14:38:38 2015 -0400

    Strip whitespace from hostname field when creating a Cloud Provider
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1217545

 app/controllers/ems_cloud_controller.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comment 11 CFME Bot 2015-10-30 21:18:50 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/0c76b40f73268dca49ff3c42a049f4217b7df07b

commit 0c76b40f73268dca49ff3c42a049f4217b7df07b
Author:     Brian McLaughlin <bmclaugh>
AuthorDate: Fri Oct 30 14:37:17 2015 -0400
Commit:     Brian McLaughlin <bmclaugh>
CommitDate: Fri Oct 30 14:38:38 2015 -0400

    Strip whitespace from additional form fields
    
    And associated tests
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1217545

 app/controllers/ems_cloud_controller.rb       |  6 ++--
 spec/controllers/ems_cloud_controller_spec.rb | 41 ++++++++++++++++++++++++++-
 2 files changed, 43 insertions(+), 4 deletions(-)

Comment 12 CFME Bot 2015-11-04 19:20:59 UTC
New commit detected on cfme/5.5.z:
https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=f80982b2d0f2601ca8a0ff011afa9474cde963f8

commit f80982b2d0f2601ca8a0ff011afa9474cde963f8
Author:     Brian McLaughlin <bmclaugh>
AuthorDate: Thu Oct 29 10:36:30 2015 -0400
Commit:     Brian McLaughlin <bmclaugh>
CommitDate: Mon Nov 2 14:16:15 2015 -0500

    Validate whitespace is removed from hostname field on Cloud Providers
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1217545

 spec/controllers/ems_cloud_controller_spec.rb | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

Comment 13 CFME Bot 2015-11-04 19:21:05 UTC
New commit detected on cfme/5.5.z:
https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=74827de9cdac8423842b9648f8373a17c61693f7

commit 74827de9cdac8423842b9648f8373a17c61693f7
Author:     Brian McLaughlin <bmclaugh>
AuthorDate: Thu Oct 29 10:41:10 2015 -0400
Commit:     Brian McLaughlin <bmclaugh>
CommitDate: Mon Nov 2 14:16:15 2015 -0500

    Strip whitespace from hostname field when creating a Cloud Provider
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1217545

 app/controllers/ems_cloud_controller.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comment 14 CFME Bot 2015-11-04 19:21:12 UTC
New commit detected on cfme/5.5.z:
https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=5bd0b10fc48c34147c3b8d276a181b438d596882

commit 5bd0b10fc48c34147c3b8d276a181b438d596882
Author:     Brian McLaughlin <bmclaugh>
AuthorDate: Fri Oct 30 14:37:17 2015 -0400
Commit:     Brian McLaughlin <bmclaugh>
CommitDate: Mon Nov 2 14:16:15 2015 -0500

    Strip whitespace from additional form fields
    
    And associated tests
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1217545

 app/controllers/ems_cloud_controller.rb       |  6 ++--
 spec/controllers/ems_cloud_controller_spec.rb | 41 ++++++++++++++++++++++++++-
 2 files changed, 43 insertions(+), 4 deletions(-)

Comment 15 CFME Bot 2015-11-04 19:21:31 UTC
New commit detected on cfme/5.5.z:
https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=f5ab54c9d012bd077111cc489480f96121e94228

commit f5ab54c9d012bd077111cc489480f96121e94228
Merge: c52adce 5bd0b10
Author:     Dan Clarizio <dclarizi>
AuthorDate: Wed Nov 4 14:15:38 2015 -0500
Commit:     Dan Clarizio <dclarizi>
CommitDate: Wed Nov 4 14:15:38 2015 -0500

    Merge branch 'bz1217545' into '5.5.z'
    
    Hostname field on new cloud provider page does not trim trailing whitespace
    
    Merged cleanly into 5.5.z, upstream PR and BZ links included below.
    
    https://github.com/ManageIQ/manageiq/pull/5182
    https://bugzilla.redhat.com/show_bug.cgi?id=1217545
    
    See merge request !328

 app/controllers/ems_cloud_controller.rb       |  6 +--
 spec/controllers/ems_cloud_controller_spec.rb | 57 +++++++++++++++++++++++++++
 2 files changed, 60 insertions(+), 3 deletions(-)

Comment 16 Taras Lehinevych 2015-11-13 10:33:41 UTC
Verified fixed in version 5.5.0.10

Comment 18 errata-xmlrpc 2015-12-08 13:06:54 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2015:2551


Note You need to log in before you can comment on or make changes to this bug.