This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 1470676 - Validations around Hostname_prefix setting are missing
Validations around Hostname_prefix setting are missing
Status: NEW
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Discovery Plugin (Show other bugs)
6.3.0
Unspecified Unspecified
medium Severity low (vote)
: Unspecified
: --
Assigned To: Lukas Zapletal
Katello QA List
: Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-07-13 08:48 EDT by Sachin Ghai
Modified: 2017-08-10 06:37 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Sachin Ghai 2017-07-13 08:48:06 EDT
Description of problem:
Hostname_prefix setting description says: The default prefix to use for the host name, must start with a letter

Since we know that prefix must start w/ letter then lets add some validation around prefix. For now I can enter any string for this setting, which may not work when host is discovered.

Like: I tried -mac(notice - ) and it was updated, though when I discovered host, given prefix was not set. So we should add validations.

Version-Release number of selected component (if applicable):
sat6.3 snap6

How reproducible:


Steps to Reproduce:
1. go to Administer -> settings -> discovered -> hostname_prefix
2. set some string which doesn't start w/ letter
3.

Actual results:
any string starting w/ special characters, number is being accepted

Expected results:
user shouldn't be able to set any random string. in case user tries to update string which doesn't start w/ letter, should get validation error.

Additional info:
Comment 2 Sachin Ghai 2017-08-10 06:37:46 EDT
Please note similar validation needs to be set in hammer:
]# hammer -u admin -p changeme settings list | grep discovery_prefix
discovery_prefix                                       |                                                                        | The default prefix to use for the host name, must start with a letter           
[root@cloud-qe]# hammer -u admin -p changeme settings set --name discovery_prefix --value "1mac"
Setting [discovery_prefix] updated to [1mac]

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