diff options
| author | Luke Kanies <luke@madstop.com> | 2005-08-06 04:58:14 +0000 |
|---|---|---|
| committer | Luke Kanies <luke@madstop.com> | 2005-08-06 04:58:14 +0000 |
| commit | a6a11487bf731585f29e4d49b91d8c0d1fffb714 (patch) | |
| tree | 4eef00d1c7cfdffee50cafd8c07fee78672853a9 /lib/puppet | |
| parent | f3c1487c1183a97a45c8e63eef37251ca6360afb (diff) | |
all tests now pass on os x
git-svn-id: https://reductivelabs.com/svn/puppet/library/trunk@502 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet')
| -rw-r--r-- | lib/puppet/statechange.rb | 2 | ||||
| -rw-r--r-- | lib/puppet/type/package.rb | 7 | ||||
| -rw-r--r-- | lib/puppet/type/pfile.rb | 29 | ||||
| -rw-r--r-- | lib/puppet/type/state.rb | 14 |
4 files changed, 40 insertions, 12 deletions
diff --git a/lib/puppet/statechange.rb b/lib/puppet/statechange.rb index 257558513..f5bd5323d 100644 --- a/lib/puppet/statechange.rb +++ b/lib/puppet/statechange.rb @@ -126,7 +126,7 @@ module Puppet #--------------------------------------------------------------- def to_s return "%s: %s changed %s to %s" % - [@state.parent, @state.name, @is, @should] + [@state.parent, @state.name, @state.is_to_s, @state.should_to_s] end #--------------------------------------------------------------- end diff --git a/lib/puppet/type/package.rb b/lib/puppet/type/package.rb index 82bba1414..77c866c08 100644 --- a/lib/puppet/type/package.rb +++ b/lib/puppet/type/package.rb @@ -441,9 +441,10 @@ module Puppet @@default = :rpm end else - raise Puppet::Error.new( - "No default type for " + Puppet::Fact["operatingsystem"] - ) + @@default = nil + #raise Puppet::Error.new( + # "No default type for " + Puppet::Fact["operatingsystem"] + #) end end diff --git a/lib/puppet/type/pfile.rb b/lib/puppet/type/pfile.rb index 3b8469458..c6f37724a 100644 --- a/lib/puppet/type/pfile.rb +++ b/lib/puppet/type/pfile.rb @@ -384,6 +384,15 @@ module Puppet @name = :mode @event = :inode_changed + # our modes are octal, so print them in decimal instead + def is_to_s + "%o" % @is + end + + def should_to_s + "%o" % @should + end + def should=(should) # this is pretty hackish, but i need to make sure the number is in # octal, yet the number can only be specified as a string right now @@ -493,15 +502,19 @@ module Puppet begin group = Etc.send(method,value) - # apparently os x is six shades of weird - os = Puppet::Fact["Operatingsystem"] - case os - when "Darwin": - gid = group.passwd - else - gid = group.gid - end + # at one time, os x was putting the gid into the passwd + # field of the group struct, but that appears to not + # be the case any more + #os = Puppet::Fact["Operatingsystem"] + #case os + #when "Darwin": + # #gid = group.passwd + # gid = group.gid + #else + #end + + gid = group.gid gname = group.name if gid.nil? diff --git a/lib/puppet/type/state.rb b/lib/puppet/type/state.rb index 38cd51fa9..6524e4aa0 100644 --- a/lib/puppet/type/state.rb +++ b/lib/puppet/type/state.rb @@ -119,6 +119,20 @@ class State < Puppet::Element #--------------------------------------------------------------- #--------------------------------------------------------------- + # because the @should and @is vars might be in weird formats, + # we need to set up a mechanism for pretty printing of the values + # default to just the values, but this way individual states can + # override these methods + def is_to_s + @is + end + + def should_to_s + @should + end + #--------------------------------------------------------------- + + #--------------------------------------------------------------- def to_s return "%s(%s)" % [@parent.name,self.name] end |
