Project

General

Profile

Refactor #10287

Provide helper methods for proxy features

Added by Stephen Benjamin almost 8 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Category:
Smart Proxy
Target version:
Difficulty:
Triaged:
Bugzilla link:
Fixed in Releases:
Found in Releases:
Red Hat JIRA:

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?"

Associated revisions

Revision 8f657a84 (diff)
Added by Stephen Benjamin almost 8 years ago

fixes #10287 - provide helper methods for proxy features

History

#1 Updated by Dominic Cleal almost 8 years ago

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.

#2 Updated by The Foreman Bot almost 8 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/2329 added
  • Pull request deleted ()

#3 Updated by Anonymous almost 8 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#4 Updated by Dominic Cleal almost 8 years ago

  • Assignee set to Stephen Benjamin
  • Legacy Backlogs Release (now unused) set to 35

#5 Updated by Lukas Zapletal over 7 years ago

  • Bugzilla link set to 1263610

Also available in: Atom PDF