Refactor #10287
closed
Provide helper methods for proxy features
Added by Stephen Benjamin almost 10 years ago.
Updated over 6 years ago.
Description
The code is sprinkled with various finds, selects, detects, maps, and so forth to determine if a proxy has a particular feature. It should be refactored to provide nice methods like "proxy.has_puppet_ca?"
It's probably best to avoid methods named after the feature names as the features are dynamic, based on what's in the database. We used to do this when looking up smart proxies, and it was terrible (https://github.com/theforeman/foreman/blob/1.8.0/app/models/smart_proxy.rb#L42-L48) because the behaviour was defined when the class was evaluated, not at runtime - making it hard to test and sometimes buggy.
#has_feature?(:puppet)
or similar might be better.
- Status changed from New to Ready For Testing
- Pull request https://github.com/theforeman/foreman/pull/2329 added
- Pull request deleted (
)
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
- Assignee set to Stephen Benjamin
- Translation missing: en.field_release set to 35
- Bugzilla link set to 1263610
Also available in: Atom
PDF