Bug 1780246

Summary: Compute resource create with region through CLI does not have validation for invalid region
Product: Red Hat Satellite Reporter: Aditi Puntambekar <apuntamb>
Component: Compute Resources - AzureAssignee: Aditi Puntambekar <apuntamb>
Status: CLOSED ERRATA QA Contact: vijsingh
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.7.0CC: egolov, pcreech
Target Milestone: 6.7.0Keywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: tfm-rubygem-foreman_azure_rm-2.0.5-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-04-14 13:27:49 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: 1775890    

Description Aditi Puntambekar 2019-12-05 15:10:15 UTC
Description of problem:

Compute resource creation with region does not have validation for invalid type of regions in CLI.

i.e. a region could pass as "East_US", "EastUS", "East-US" however, valid one is 'eastus'(lower case)

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:

 # hammer compute-resource create --name CLI_Test1 --organization-id 1 --location-id 2 --provider AzureRM --app-ident "your-app-id" --secret-key "your_key_details" --sub-id "your_sub_id" --tenant "your_tenat_id" --region "East-US" 
Compute resource created.

 # hammer compute-resource create --name CLI_Test2 --organization-id 1 --location-id 2 --provider AzureRM --app-ident "your-app-id" --secret-key "your_key_details" --sub-id "your_sub_id" --tenant "your_tenat_id" --region "EastUS" 
Compute resource created.

 # hammer compute-resource create --name CLI_Test3 --organization-id 1 --location-id 2 --provider AzureRM --app-ident "your-app-id" --secret-key "your_key_details" --sub-id "your_sub_id" --tenant "your_tenat_id" --region "East_US" 
Compute resource created.

 # hammer compute-resource create --name CLI_Test4 --organization-id 1 --location-id 2 --provider AzureRM --app-ident "your-app-id" --secret-key "your_key_details" --sub-id "your_sub_id" --tenant "your_tenat_id" --region "eastus" 
Compute resource created.

Actual results:
Compute Resource is created.

Expected results:
Compute Resource should not be created. An error should be displayed stating Invalid region type. Please enter region in lowercase.

Additional info:

Comment 3 vijsingh 2019-12-17 10:14:14 UTC
ON_QA failed:

@Satellite 6.7.0 snap 6.0


Steps/Observation:

 - Validation is exists now however return message requires to update for 'special characters' as well along with an example.

 i.e.  
  
   using below:
  
    --region "east-us"  => shows return message  "Could not create the compute resource:  Region east-us must be lowercase."

    --region  "east_us"  => shows return message  "Could not create the compute resource:  Region east_us must be lowercase."

Comment 5 vijsingh 2020-01-17 11:13:10 UTC
ON_QA Verified

@Satellite 6.7.0 snap 8.0

Observation:

 - Validation exists:
   
   """
   Could not create the compute resource:
   Region EAST-east must be lowercase eg. 'eastus'. No special characters allowed.
   """

Comment 8 errata-xmlrpc 2020-04-14 13:27:49 UTC
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-2020:1454