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 a bug when running Rbac on VimPerformanceDaily #20058

Merged
merged 1 commit into from
Apr 8, 2020

Conversation

kbrock
Copy link
Member

@kbrock kbrock commented Apr 8, 2020

Rbac.filtered(VimPerformanceDaily) rendered the following:

     Failure/Error: return klass.name[0..-12].constantize.base_class
     
     NameError:
       uninitialized constant VimPer

The problem was that it was saying that VimPerformanceTag
runs the security off of an associated class.

VmPerformance and HostPerformance have associated classes: Vm and Host respectively.

The code actually derives the associated code from the class name by
removing "performance" (11 letters) from the end.

But VimPerformanceTag is not associated with a model, and the name
does not end in Performance. Unsurprisingly stripping off the last
11 letters result in an error.

`Rbac.filtered(VimPerformanceDaily)` rendered the following:

```
     Failure/Error: return klass.name[0..-12].constantize.base_class
     
     NameError:
       uninitialized constant VimPer
```

The problem was that it was saying that `VimPerformanceTag` has an associated with a class.

`VmPerformance` and `HostPerformance` have associated classes (`Vm` and `Host` respectively).
This code derives the associated code from the class name by
removing `"performance"` (11 letters) from the end.

But `VimPerformanceTag` is not associated with a model, so
stripping off the last 11 letters (which aren't the word performance)
@miq-bot
Copy link
Member

miq-bot commented Apr 8, 2020

Checked commit kbrock@048c861 with ruby 2.5.7, rubocop 0.69.0, haml-lint 0.28.0, and yamllint
2 files checked, 0 offenses detected
Everything looks fine. 🏆

@Fryguy Fryguy merged commit 58ca113 into ManageIQ:master Apr 8, 2020
@Fryguy Fryguy self-assigned this Apr 8, 2020
@kbrock kbrock deleted the rbac_performance_targets branch April 8, 2020 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants