Sha256: 0bfa057e6b9ef1f0587013acf4b8bf9cebbb68902895c78f27e4a0764b93abc7
Contents?: true
Size: 1.45 KB
Versions: 7
Compression:
Stored size: 1.45 KB
Contents
module LinuxAdmin class RegistrationSystem include Common include Logging def self.registration_type(reload = false) return @registration_type if @registration_type && !reload @registration_type = registration_type_uncached end def self.method_missing(meth, *args, &block) if white_list_methods.include?(meth) r = self.registration_type.new raise NotImplementedError, "#{meth} not implemented for #{self.name}" unless r.respond_to?(meth) r.send(meth, *args, &block) else super end end def registered? false end private def self.registration_type_uncached if Rhn.new.registered? Rhn elsif SubscriptionManager.new.registered? SubscriptionManager else self end end private_class_method :registration_type_uncached def self.white_list_methods @white_list_methods ||= begin all_methods = RegistrationSystem.instance_methods(false) + Rhn.instance_methods(false) + SubscriptionManager.instance_methods(false) all_methods.uniq end end private_class_method :white_list_methods def install_server_certificate(server, cert_path) host = server.start_with?("http") ? URI.parse(server).host : server LinuxAdmin::Rpm.upgrade("http://#{host}/#{cert_path}") end end end Dir.glob(File.join(File.dirname(__FILE__), "registration_system", "*.rb")).each { |f| require f }
Version data entries
7 entries across 7 versions & 1 rubygems