Project

General

Profile

Actions

Refactor #21205

closed

Replace alias_method_chain with Module prepend

Added by Ivan Necas almost 7 years ago. Updated almost 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Target version:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

One of the reasons is to remove the rails 5 deprecation. The other is the tests
in against foreman on ruby 2.2.2 currently failing on

in HostTest.test_0100_#reload drops primary and provision interface cache
expected exactly once, invoked once: #<Host::Managed:0x1cf9a8a0>.drop_provision_interface_cache(any_parameters)
 (Minitest::Assertion)

The issues seems to be caused by super in https://github.com/theforeman/foreman/blob/715d097cbd058d171c8a2c65ad5d519d128d1123/app/models/host/base.rb#L290
calling the very same method once again, when called from `refresh_with_remote_execution`. Replacing alias_method_chain with
prepend seemed to help with the issue


Related issues 4 (0 open4 closed)

Related to Foreman Remote Execution - Bug #21242: SystemStackError (stack level too deep) when calling smart proxy features refresh with Katello 3.4ClosedIvan Necas10/09/2017Actions
Related to Katello - Bug #21243: Rails 5 - Replace alias_method_chain with Module prependClosedJustin Sherrill10/09/2017Actions
Related to Boot disk - Bug #14797: Medium validation wrong with Katello and foreman_bootdiskClosedLukas ZapletalActions
Blocks Foreman - Tracker #20948: Rails 5.1 upgrade tasksClosed09/16/2017

Actions
Actions

Also available in: Atom PDF