Skip to content

Commit

Permalink
Merge pull request #3438 from candlepin/mhorky/cct-654-disable-autore…
Browse files Browse the repository at this point in the history
…g/el10

feat: Disable anonymous cloud registration temporarily
  • Loading branch information
jirihnidek authored Aug 5, 2024
2 parents 7568520 + 5a75445 commit 3565182
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions src/subscription_manager/scripts/rhsmcertd_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,16 +211,20 @@ def _auto_register(cp_provider: "CPProvider") -> ExitStatus:
log.info("Standard automatic registration was successful.")
return ExitStatus.OK

if token["tokenType"] == "CP-Anonymous-Cloud-Registration":
try:
_auto_register_anonymous(uep=uep, token=token)
cache.CloudTokenCache.delete_cache()
except Exception:
log.exception("Anonymous automatic registration failed.")
return ExitStatus.REGISTRATION_FAILED
else:
log.info("Anonymous automatic registration was successful.")
return ExitStatus.OK
# Uncomment the following block to enable automatic cloud registration v2.
# This feature has been disabled temporarily to ensure we do not cause
# regressions by not having the backend fully prepared and tested.

# if token["tokenType"] == "CP-Anonymous-Cloud-Registration":
# try:
# _auto_register_anonymous(uep=uep, token=token)
# cache.CloudTokenCache.delete_cache()
# except Exception:
# log.exception("Anonymous automatic registration failed.")
# return ExitStatus.REGISTRATION_FAILED
# else:
# log.info("Anonymous automatic registration was successful.")
# return ExitStatus.OK

log.error(f"Unsupported token type for automatic registration: {token['tokenType']}.")
return ExitStatus.BAD_TOKEN_TYPE
Expand Down

0 comments on commit 3565182

Please sign in to comment.