Skip to content
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

Fix AttributeError: 'Authorization' object has no attribute 'log' #660

Merged
merged 2 commits into from
Jan 15, 2025

Conversation

MetRonnie
Copy link
Member

@MetRonnie MetRonnie commented Jan 13, 2025

Edit: fixes a bug introduced in #613

Check List

  • I have read CONTRIBUTING.md and added my name as a Code Contributor.
  • Contains logically grouped changes (else tidy your branch by rebase).
  • Does not contain off-topic changes (use other PRs for other changes).
  • Tests are included (or explain why tests are not needed).
  • Changelog entry included if this is a change that can affect users
  • If this is a bug fix, PR should be raised against the relevant ?.?.x branch.

@MetRonnie MetRonnie added bug Something isn't working small labels Jan 13, 2025
@MetRonnie MetRonnie added this to the 1.6.x milestone Jan 13, 2025
@MetRonnie MetRonnie requested a review from wxtim January 14, 2025 17:05
@MetRonnie MetRonnie modified the milestones: 1.6.x, 1.6.1 Jan 14, 2025
@wxtim
Copy link
Member

wxtim commented Jan 15, 2025

Please can you paste what you did to demonstrate the bug?

Comment on lines -168 to +173
self.owner_user_groups: List[str] = self._get_groups(
self.owner_user_name
)
self.log = log
self.owner_auth_conf: dict = owner_auth_conf
self.site_auth_config: dict = site_auth_conf
self.owner_user_groups: List[str] = self._get_groups(
self.owner_user_name
)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know how to reproduce it, but the cause should be fairly self-evident from looking at self._get_groups():

good_groups, bad_groups = get_groups(user)
if bad_groups:
self.log.warning(
f'{user} has the following invalid groups in their profile '
f'{bad_groups} - these groups will be ignored.'
)

Can't use self.log before it's been defined

Copy link
Member

@wxtim wxtim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏼

@MetRonnie MetRonnie merged commit 693c897 into cylc:1.6.x Jan 15, 2025
5 of 6 checks passed
@MetRonnie MetRonnie deleted the attribute-error branch January 15, 2025 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working small
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants