Bug 671463 - [RFE] Validate new Host address ( FQDN....) - REST interfaces
Summary: [RFE] Validate new Host address ( FQDN....) - REST interfaces
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: RFEs
Version: ---
Hardware: Unspecified
OS: Unspecified
high
low vote
Target Milestone: ---
: ---
Assignee: Barak
QA Contact: Pavel Stehlik
URL:
Whiteboard: infra
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-01-21 15:35 UTC by Matthew Booth
Modified: 2016-02-10 19:39 UTC (History)
15 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-12-31 09:07:09 UTC
oVirt Team: Infra
ylavi: ovirt-future?
rule-engine: planning_ack?
rule-engine: devel_ack?
rule-engine: testing_ack?


Attachments (Terms of Use)

Description Matthew Booth 2011-01-21 15:35:34 UTC
When I go to Hosts->New in RHEV Manager and enter 'red.rhev.marston' in the Address field, it gives me the following error message in a tool tip:

Address should be an IP Address or a Fully Qualified Domain Name (FQDN)

'red.rhev.marston' is the FQDN for this host. I suspect this is related to similar bug I filed a while back, I think for storage domains. In that case, the code was doing some invalid heuristic check on the FQDN. IIRC, it was checking the length of the final name component. Note that DNS puts no requirement on this, and private domains are both common and best practise on private networks.

Comment 2 Miki Kenneth 2011-02-16 12:37:20 UTC
This is not the issue at all! the reg-ex is not the issue.
The issue is that we need to validate the address by pinging it. 
As it stand now, we can create tons of hosts (illegal IP/FQDN address). lines in the DB, that are actually nothing....

See also the discussion on: 677343

Comment 6 Miki Kenneth 2011-03-02 12:24:05 UTC
I think that SSH is doing a bit too much in order to just validate the FQDN....
but you guys are the experts.

Comment 16 Alon Bar-Lev 2012-11-28 08:37:41 UTC
I see no problem in current implementation about to be rhev-3.2.

Closing for now,

Comment 18 Alon Bar-Lev 2012-12-23 11:34:28 UTC
I don't know exactly what the logic is...

1.1.1 - fails.
1.1.1a - success.
1.1.1.a - success
1.1.1.1 - success
1.1.1.1.1 - fails
300.1.1.1 - fails
1a.1.1.1 - fails
1.1a.1.1 - fails

I guess that every component which begins with number is treated as ip address, all other is accepted.

Why should be do any validation on this field?

But at least this works better than what was when comment#0 posted.

Comment 20 Barak 2013-01-01 10:34:49 UTC
I'm not sure a validity check is relevant for this field.

It is clear that the above validity check is not correct.

I would suggest to change it to not empty validity only.

And if we want to add a real validity check then do a connection check on the engine.

Yaniv, Simon please advise.

This obviously not a change for 3.2 hence moving to rhevm-future.

Comment 21 Simon Grinberg 2013-01-01 12:34:02 UTC
(In reply to comment #20)

> Yaniv, Simon please advise.
> 
> This obviously not a change for 3.2 hence moving to rhevm-future.

According to:
https://bugzilla.redhat.com/show_bug.cgi?id=691177#c5

Webadmin validates this properly. 

So we are left with REST based interfaces - I tend to say that if the SSH attempt (which is the first stage of installing a host) fails with proper message then validation can be reduce to non empty and no white spaces. 

Can this be easily done for 3.2?
P.S. If the current validation covered the above (and the error message is clear as stated above) but just does not detect some of the illegal combinations then you can leave this at future (if not even defer)

Comment 23 Barak 2014-01-01 17:09:01 UTC
moved back to new - to reset the work on this issue


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