diff options
author | Luke Kanies <luke@madstop.com> | 2005-07-14 18:53:04 +0000 |
---|---|---|
committer | Luke Kanies <luke@madstop.com> | 2005-07-14 18:53:04 +0000 |
commit | ad9913bf3a8b43bfce2d1203ce69b7daf75ebd7a (patch) | |
tree | 9896ebce994133e1e3a4a643f679ac0026d81890 | |
parent | 13945c5a2e19ee4f85777de5accce79114508bff (diff) | |
download | puppet-ad9913bf3a8b43bfce2d1203ce69b7daf75ebd7a.tar.gz puppet-ad9913bf3a8b43bfce2d1203ce69b7daf75ebd7a.tar.xz puppet-ad9913bf3a8b43bfce2d1203ce69b7daf75ebd7a.zip |
converting debug() back to Puppet.debug()
git-svn-id: https://reductivelabs.com/svn/puppet/library/trunk@395 980ebf18-57e1-0310-9a29-db15c13687c0
-rw-r--r-- | lib/puppet/type.rb | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/lib/puppet/type.rb b/lib/puppet/type.rb index b49bc19e8..53318f84c 100644 --- a/lib/puppet/type.rb +++ b/lib/puppet/type.rb @@ -235,7 +235,7 @@ class Type < Puppet::Element # remove all type instances; this is mostly only useful for testing def self.allclear @@typeary.each { |subtype| - debug "Clearing %s of objects" % subtype + Puppet.debug "Clearing %s of objects" % subtype subtype.clear } end @@ -310,7 +310,7 @@ class Type < Puppet::Element # set the parameters for a type; probably only used by FileRecord # objects def self.parameters=(params) - debug "setting parameters to [%s]" % params.join(" ") + Puppet.debug "setting parameters to [%s]" % params.join(" ") @parameters = params.collect { |param| if param.class == Symbol param @@ -387,7 +387,7 @@ class Type < Puppet::Element self.send(("meta" + mname.id2name),value) elsif stateklass = self.class.validstate?(mname) if value.is_a?(Puppet::State) - debug "'%s' got handed a state for '%s'" % [self,mname] + Puppet.debug "'%s' got handed a state for '%s'" % [self,mname] @states[mname] = value else if @states.include?(mname) @@ -716,12 +716,12 @@ class Type < Puppet::Element states.each { |state| unless state.insync? - debug("%s is not in sync" % state) + Puppet.debug("%s is not in sync" % state) insync = false end } - debug("%s sync status is %s" % [self,insync]) + Puppet.debug("%s sync status is %s" % [self,insync]) return insync end #--------------------------------------------------------------- @@ -826,7 +826,7 @@ class Type < Puppet::Element raise "Could not retrieve object '%s' of type '%s'" % [name,type] end - debug("%s requires %s" % [self.name,object]) + Puppet.debug("%s requires %s" % [self.name,object]) # for now, we only support this one method, 'refresh' object.subscribe( @@ -841,7 +841,7 @@ class Type < Puppet::Element #--------------------------------------------------------------- def metaonerror(response) - debug("Would have called metaonerror") + Puppet.debug("Would have called metaonerror") @onerror = response end #--------------------------------------------------------------- @@ -860,10 +860,14 @@ class Type < Puppet::Element #--------------------------------------------------------------- def Type.debug(value) - if value == "false" or value == false + if value == "false" or value == false or value == 0 or value == "0" Puppet[:debug] = false else - Puppet[:debug] = true + #Puppet[:debug] = true + puts "Got %s for debug value" % value + if value == true + raise "Crap! got a true!" + end end end |