Force rhc_organization variable to be interger#227
Conversation
This is not correct: the organization ID is defined as string in the registration server: It looks like an integer now, yes, however there is no requirement for it to be so. It is also documented to be a string both in the README.md of this repository and in the RHEL documentation: |
b75d1b7 to
d1849f2
Compare
Ahh, thanks for pointing out the flaw in my assumption. We can |
In situations where we're unmarshaling data from json to form variables, it's possible that those values can be unmarshalled as floating point numbers. Which would be incompatible with the current org ID's. This change asserts that the type value of rhc_organization should be a string. Jira: https://issues.redhat.com/browse/OSPRH-15097 Signed-off-by: Brendan Shephard <bshephar@redhat.com>
d1849f2 to
34ec42e
Compare
|
Actually, no, that doesn't work either because then we'll just end up with |
... but why? Many of the parameters of the role are strings, and I do not see why
... because I find this as clear issue of whatever fills |
|
Yeah, that's fair enough. The problem is that we have an interface to allow users to provide arbitrary ansible variables, it just so happens to also be the interface for subscription-manager. Since the inputs are arbitrary, we can't unmarshal them with Go into a struct with fixed types, so we ultimately end up with floating point numbers for all numbers as a symptom. But that is really our problem, not yours. I can fix for that by ensuring we call your role with the expected value. Cheers for the discussion |
Enhancement:
All values for
rhc_organizationshould be interger values. This change asserts that requirement by ensuring the value is an integer before trying to register.Reason:
In situations where we're unmarshaling data from json to form variables, it's possible that those values can be unmarshalled as floating point numbers. Which would be incompatible with the current org ID's. This change asserts that the type of number for rhc_organization should be an integer.
Result:
Issue Tracker Tickets (Jira or BZ if any):
Jira: https://issues.redhat.com/browse/OSPRH-15097