-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
redhat_subscription: refactor of internal Rhsm class #6658
redhat_subscription: refactor of internal Rhsm class #6658
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Can you add a changelog fragment (minor_changes
, just mention that some internal refactoring happened)?
Not to minimize the recommendation: would it be really something needs to be aware by reading release notes? |
We have the general rule of always having a changelog fragment for any code change that affects |
The two RegistrationBase & Rhsm classes were copied from the ones in the shared module_utils.redhat module; that said: - the versions here got improvements over the years - the RegistrationBase in module_utils.redhat is used only by the RHN modules, which are deprecated and slated for removal Hence, the classes here can be kept and simplified a bit: - fold the non-dummy content of RegistrationBase into Rhsm: there is no more need for the separate RegistrationBase base class - drop the init arguments "username", "password", and "token": the instance variables of them are not used anywhere, as the needed credentials (together with other variables) are passed to the register() method - create the Rhsm object later in main(), after the AnsibleModule creation and the uid check: this avoids the creation of Rhsm with a null module variable, changing it later There should be no behaviour change.
2d81aec
to
deebdb8
Compare
Backport to stable-7: 💚 backport PR created✅ Backport PR branch: Backported as #6667 🤖 @patchback |
@ptoscano thanks! |
The two RegistrationBase & Rhsm classes were copied from the ones in the shared module_utils.redhat module; that said: - the versions here got improvements over the years - the RegistrationBase in module_utils.redhat is used only by the RHN modules, which are deprecated and slated for removal Hence, the classes here can be kept and simplified a bit: - fold the non-dummy content of RegistrationBase into Rhsm: there is no more need for the separate RegistrationBase base class - drop the init arguments "username", "password", and "token": the instance variables of them are not used anywhere, as the needed credentials (together with other variables) are passed to the register() method - create the Rhsm object later in main(), after the AnsibleModule creation and the uid check: this avoids the creation of Rhsm with a null module variable, changing it later There should be no behaviour change. (cherry picked from commit 42f7531)
…of internal Rhsm class (#6667) redhat_subscription: refactor of internal Rhsm class (#6658) The two RegistrationBase & Rhsm classes were copied from the ones in the shared module_utils.redhat module; that said: - the versions here got improvements over the years - the RegistrationBase in module_utils.redhat is used only by the RHN modules, which are deprecated and slated for removal Hence, the classes here can be kept and simplified a bit: - fold the non-dummy content of RegistrationBase into Rhsm: there is no more need for the separate RegistrationBase base class - drop the init arguments "username", "password", and "token": the instance variables of them are not used anywhere, as the needed credentials (together with other variables) are passed to the register() method - create the Rhsm object later in main(), after the AnsibleModule creation and the uid check: this avoids the creation of Rhsm with a null module variable, changing it later There should be no behaviour change. (cherry picked from commit 42f7531) Co-authored-by: Pino Toscano <[email protected]>
SUMMARY
The two
RegistrationBase
&Rhsm
classes were copied from the ones in the sharedmodule_utils.redhat
module; that said:RegistrationBase
inmodule_utils.redhat
is used only by the RHN modules, which are deprecated and slated for removalHence, the classes here can be kept and simplified a bit:
RegistrationBase
intoRhsm
: there is no more need for the separateRegistrationBase
base classusername
,password
, andtoken
: the instance variables of them are not used anywhere, as the needed credentials (together with other variables) are passed to theregister()
methodRhsm
object later inmain()
, after theAnsibleModule
creation and the uid check: this avoids the creation ofRhsm
with a null module variable, changing it laterThere should be no behaviour change.
ISSUE TYPE
COMPONENT NAME
redhat_subscription