Bug 1304500

Summary: Validation on IP addressed failed with a comma present
Product: Red Hat Quickstart Cloud Installer Reporter: John Matthews <jmatthew>
Component: fusor-installerAssignee: Jason Montleon <jmontleo>
Status: CLOSED DEFERRED QA Contact: Tasos Papaioannou <tpapaioa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 1.0CC: apagac, jmontleo, tpapaioa
Target Milestone: TP3Keywords: Triaged
Target Release: 1.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-02-25 17:27:21 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1315447    

Description John Matthews 2016-02-03 20:12:00 UTC
Description of problem:

Seen during hackathon we weren't validating comma in IP Address


Steps to Reproduce:
1. Test from ISO install
2. Enter in IP Address as 192,168.155.10
3. See lack of error validation.
4. Proceeding will break system

Comment 1 Jason Montleon 2016-03-21 16:14:27 UTC
https://github.com/fusor/fusor-installer/pull/53 will fix this

Comment 2 John Matthews 2016-04-11 20:42:00 UTC
RHEL-OSP nodes setup restrictions

Comment 3 John Matthews 2016-04-11 20:42:32 UTC
Addressed in TP3 RC3

Comment 4 Tasos Papaioannou 2016-04-18 16:52:36 UTC
With the changes from https://github.com/fusor/fusor-installer/pull/53 , validate_ntp_host in /usr/share/katello-installer/hooks/lib/provisioning_wizard.rb looks like this:

---
  def validate_ntp_host
    if @ntp_host.nil? || @ntp_host.empty?
      'NTP sync host must be specified'
    elsif !(valid_hostname?(@ntp_host))  && !(valid_hostname?(@ntp_host))
      'NTP sync host - Invalid Hostname or IP address'
    end
  end
---

What's the reason for having

!(valid_hostname?(@ntp_host))  && !(valid_hostname?(@ntp_host))

instead of just

!(valid_hostname?(@ntp_host))

? 

Maybe it was intended to be:

!(valid_ip?(@ntp_host)) || !(valid_hostname?(@ntp_host))

?

Comment 5 Jason Montleon 2016-04-18 20:08:23 UTC
This is what was meant. It should be possible to enter an IP or hostname for the ntp host.

!(valid_ip?(@ntp_host)) || !(valid_hostname?(@ntp_host))

Comment 6 Tasos Papaioannou 2016-04-18 23:10:45 UTC
Shouldn't it be:

!(valid_ip?(@ntp_host)) && !(valid_hostname?(@ntp_host))

i.e., if (not a valid ip address) AND (not a valid hostname), then return ''NTP sync host - Invalid Hostname or IP address'?

Comment 7 Jason Montleon 2016-04-21 14:46:41 UTC
Yes. I think we're saying the same thing; it's a bug and should be fixed. Working on it now

Comment 8 Tasos Papaioannou 2016-04-21 15:44:10 UTC
Verified on fusor-installer-0.0.14-40.el7_2.noarch.rpm

Comment 9 Jason Montleon 2016-04-22 13:38:10 UTC
https://github.com/fusor/fusor-installer/pull/55

Comment 10 Sudhir Mallamprabhakara 2019-02-25 17:27:21 UTC
QCI has sunset. Closing the BZ's.