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?)
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.
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.
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(-)
Failed verification 5.5.0.3-alpha1.2.20150929172214_2eda7b4
https://github.com/ManageIQ/manageiq/pull/5182
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(+)
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(-)
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(-)
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(+)
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(-)
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(-)
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(-)
Verified fixed in version 5.5.0.10
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