Project

General

Profile

Actions

Refactor #10287

closed

Provide helper methods for proxy features

Added by Stephen Benjamin about 9 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Normal
Category:
Smart Proxy
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

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

Actions #1

Updated by Dominic Cleal about 9 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.

Actions #2

Updated by The Foreman Bot about 9 years ago

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

Updated by Anonymous about 9 years ago

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

Updated by Dominic Cleal about 9 years ago

  • Assignee set to Stephen Benjamin
  • translation missing: en.field_release set to 35
Actions #5

Updated by Lukas Zapletal over 8 years ago

  • Bugzilla link set to 1263610
Actions

Also available in: Atom PDF