Bug 1451245

Summary: [DNS] - Validate empty DNS configuration and mark field in red
Product: [oVirt] ovirt-engine Reporter: Michael Burman <mburman>
Component: BLL.NetworkAssignee: Martin Mucha <mmucha>
Status: CLOSED CURRENTRELEASE QA Contact: Michael Burman <mburman>
Severity: low Docs Contact:
Priority: low    
Version: 4.2.0CC: bugs, mmucha
Target Milestone: ovirt-4.2.0Flags: rule-engine: ovirt-4.2+
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-12-20 11:27:40 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Network RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1160667    
Attachments:
Description Flags
screenshot none

Description Michael Burman 2017-05-16 08:26:00 UTC
Description of problem:
[DNS] - Validate empty DNS configuration and mark field in red. 

It is possible to check the 'DNS Configuration' check box with empty 'DNS Servers' filed and it's possible to press 'OK" to approve operation and we get:

Error while executing action: 

size must be between 1 and 2
Attribute: network.dnsResolverConfiguration.nameServers

2017-05-16 11:14:05,016+03 WARN  [org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand] (default task-11) [84552b7c-1239-4c86-bbad-ac77afd87327] Validation of action 'UpdateNetwork' failed for user admin@internal-authz. Reasons: VAR__TYPE__NETWORK,VAR__ACTION__UPDATE,size must be between 1 and 2,$groups [Ljava.lang.Class;@11c98c2f,$min 1,$message {javax.validation.constraints.Size.message},$payload [Ljava.lang.Class;@158fcaad,$max 2,ACTION_TYPE_FAILED_ATTRIBUTE_PATH,$path network.dnsResolverConfiguration.nameServers,$validatedValue []


Version-Release number of selected component (if applicable):
 4.2.0-0.0.master.20170514130938.gitacb8b09.el7.centos
DNS rpms on top of the master version. 

How reproducible:
100

Steps to Reproduce:
1. Check the 'DNS Configuration' checkbox, but don't fill in the name server, and press 'OK"

Actual results:
Failed with error:
Error while executing action: 

size must be between 1 and 2
Attribute: network.dnsResolverConfiguration.nameServers

Expected results:
Engine should require to fill a name server if the 'DNS Configuration' checkbox is checked and it should color the 'DNS Servers' field in red, same behaviour we have for other fields in all dialogs.

Comment 2 Michael Burman 2017-06-06 05:51:24 UTC
Hi Martin, 

I saw in the patch that you can't mark the unset field in red and you marked the checkbox as invalid(attaching screenshot of how it looks now on master). 
Can you please make the invalid checkbox mark in red color?

Comment 3 Michael Burman 2017-06-06 05:51:52 UTC
Created attachment 1285205 [details]
screenshot

Comment 4 Martin Mucha 2017-06-06 13:37:15 UTC
maybe, but I shouldn't.
We actually saw that happening with UI guy here in brno. This is how all 'invalid' checkboxes are styled. They have some css class, which is not defined.

So from point of view of this patch, it's OK and unrelated, IIUC. We should fill a bug for UI guys, to fix CSS definitions.

Comment 5 Michael Burman 2017-07-03 09:04:25 UTC
Verified on - 4.2.0-0.0.master.20170702100738.git46a9f67.el7.centos

Comment 6 Sandro Bonazzola 2017-12-20 11:27:40 UTC
This bugzilla is included in oVirt 4.2.0 release, published on Dec 20th 2017.

Since the problem described in this bug report should be
resolved in oVirt 4.2.0 release, published on Dec 20th 2017, it has been closed with a resolution of CURRENT RELEASE.

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