prevent @@subclasses from being emptied
This can happen due to Chef's stupid approach to loading library files, which uses Kernel#load rather than #require. Consequently a library can get loaded twice: once by Chef::RunContext#load_libraries and once by another library file which depends on it. This is also the cause of the TYPE constants being redefined.
This commit is contained in:
@@ -4,7 +4,7 @@ module Pacemaker
|
||||
class CIBObject
|
||||
attr_accessor :name, :definition
|
||||
|
||||
@@subclasses = { }
|
||||
@@subclasses = { } unless class_variable_defined?(:@@subclasses)
|
||||
|
||||
class << self
|
||||
attr_reader :object_type
|
||||
|
Reference in New Issue
Block a user