Bug 1548153 - Colons are unhandled in BaseModel key generation in AzureArmrest
Summary: Colons are unhandled in BaseModel key generation in AzureArmrest
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Providers
Version: 5.8.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: GA
: 5.10.0
Assignee: Daniel Berger
QA Contact: Dave Johnson
URL:
Whiteboard:
Depends On:
Blocks: 1551696 1551697
TreeView+ depends on / blocked
 
Reported: 2018-02-22 20:49 UTC by Robb Manes
Modified: 2021-09-09 13:16 UTC (History)
7 users (show)

Fixed In Version: 5.10.0.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1551696 1551697 (view as bug list)
Environment:
Last Closed: 2018-08-01 02:48:02 UTC
Category: ---
Cloudforms Team: Azure
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Robb Manes 2018-02-22 20:49:01 UTC
Description of problem:
Similarly to bz1495318, it is possible for a ':' to be present in an key returned from Azure.  This causes refreshes to fail consistently.  Errors are similar to:

NameError: wrong constant name AzureAutomationRunbookUtilities:120:name
	from /opt/rh/cfme-gemset/gems/azure-armrest-0.9.1/lib/azure/armrest/model/base_model.rb:244:in `const_defined?'
	from /opt/rh/cfme-gemset/gems/azure-armrest-0.9.1/lib/azure/armrest/model/base_model.rb:244:in `nested_object'
	from /opt/rh/cfme-gemset/gems/azure-armrest-0.9.1/lib/azure/armrest/model/base_model.rb:235:in `block in __setobj__'
	from /opt/rh/cfme-gemset/gems/azure-armrest-0.9.1/lib/azure/armrest/model/base_model.rb:225:in `each'
	from /opt/rh/cfme-gemset/gems/azure-armrest-0.9.1/lib/azure/armrest/model/base_model.rb:225:in `__setobj__'
	from /opt/rh/cfme-gemset/gems/azure-armrest-0.9.1/lib/azure/armrest/model/base_model.rb:119:in `initialize'
	from /opt/rh/cfme-gemset/gems/azure-armrest-0.9.1/lib/azure/armrest/model/base_model.rb:248:in `new'
	from /opt/rh/cfme-gemset/gems/azure-armrest-0.9.1/lib/azure/armrest/model/base_model.rb:248:in `nested_object'
	from /opt/rh/cfme-gemset/gems/azure-armrest-0.9.1/lib/azure/armrest/model/base_model.rb:235:in `block in __setobj__'
	from /opt/rh/cfme-gemset/gems/azure-armrest-0.9.1/lib/azure/armrest/model/base_model.rb:225:in `each'
	from /opt/rh/cfme-gemset/gems/azure-armrest-0.9.1/lib/azure/armrest/model/base_model.rb:225:in `__setobj__'
	from /opt/rh/cfme-gemset/gems/azure-armrest-0.9.1/lib/azure/armrest/model/base_model.rb:119:in `initialize'
	from /opt/rh/cfme-gemset/gems/azure-armrest-0.9.1/lib/azure/armrest/model/base_model.rb:248:in `new'
	from /opt/rh/cfme-gemset/gems/azure-armrest-0.9.1/lib/azure/armrest/model/base_model.rb:248:in `nested_object'
	from /opt/rh/cfme-gemset/gems/azure-armrest-0.9.1/lib/azure/armrest/model/base_model.rb:235:in `block in __setobj__'
	from /opt/rh/cfme-gemset/gems/azure-armrest-0.9.1/lib/azure/armrest/model/base_model.rb:225:in `each'

Or any other 'wrong constant name' that possesses a colon.

This is easily fixed (Daniel already did this for '$').  To resolve this, we just turn ':' to '_' so it is callable.

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

How reproducible:
Every Time

Steps to Reproduce:
1. Have an Azure template configuration that has a colon in a key name
2. Exception will occur as colon cannot be converted to key symbol

Actual results:
Exception should not occur when keys contain colons.

Expected results:
Keys with ':' should be converted to '_'.

Comment 1 Robb Manes 2018-02-22 20:51:04 UTC
PR submitted at https://github.com/ManageIQ/azure-armrest/pull/358

Comment 3 Daniel Berger 2018-02-26 17:59:37 UTC
PR was subitted by Robb and merged. Thanks Robb!

I'll need to push out a new release of azure-armrest, then update the gemspec as a PR.

Comment 4 Daniel Berger 2018-02-26 17:59:59 UTC
Link to PR in question: https://github.com/ManageIQ/azure-armrest/pull/358


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