/usr/lib/ruby/1.8/mcprovision.rb is in mcollective-server-provisioner 0.0.1~git20110120-0ubuntu5.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | require 'mcollective'
require 'yaml'
require 'logger'
require 'pp'
include MCollective::RPC
module MCProvision
autoload :Config, "mcprovision/config"
autoload :PuppetMaster, "mcprovision/puppetmaster"
autoload :Nodes, "mcprovision/nodes"
autoload :Node, "mcprovision/node"
autoload :Util, "mcprovision/util"
autoload :Runner, "mcprovision/runner"
autoload :Notifier, "mcprovision/notifier"
VERSION = "1.0.0"
def self.logfile(logfile, loglevel)
@@logfile = logfile
@@logger = Logger.new(logfile, 5, 102400)
case loglevel
when "debug"
@@logger.level = Logger::DEBUG
when "warn"
@@logger.level = Logger::WARN
else
@@logger.level = Logger::INFO
end
end
def self.version
VERSION
end
def self.warn(msg)
MCProvision.log(Logger::WARN, msg)
end
def self.info(msg)
MCProvision.log(Logger::INFO, msg)
end
def self.debug(msg)
MCProvision.log(Logger::DEBUG, msg)
end
def self.log(severity, msg)
begin
from = File.basename(caller[1])
@@logger.add(severity) { "#{$$} #{from}: #{msg}" }
rescue Exception => e
end
end
end
|