Unauthorized error when project's domain is not default

Bug #1847233 reported by Niels van Huijstee
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
ospurge
New
Undecided
Unassigned

Bug Description

In the main module, you are using connect_as_project using the given project name_or_id from the command line: https://opendev.org/x/ospurge/src/branch/master/ospurge/main.py#L116. This does however not update the project_domain_id. If the target project is under a different domain than default, that results in an authorization error when trying to get the cloud.current_user_id.

You can resolve this by replacing the connect_as_project(options.purge_project) with connect_as_project(project). I've attached a patch that fixes this.

Revision history for this message
Niels van Huijstee (uhavin) wrote :
Revision history for this message
Niels van Huijstee (uhavin) wrote :

There's more that needs to be changed, as the role assignment of the admin user on the target project also fails. I've added a quick (and not so beautiful) solution in another patch, which sets the admin cloud's user_id to self.user_id and sets self.project_id with the id from the project munch. Sorry I didn't catch this before.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.