diff options
| author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2007-05-09 23:08:42 +0000 |
|---|---|---|
| committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2007-05-09 23:08:42 +0000 |
| commit | 1d23013abf9e8db5aa405c87ac6657df3f050926 (patch) | |
| tree | 9e0cb3f82fea8ffdcfacc4637e1412454f538e34 /lib/puppet/provider/zone | |
| parent | de212261e75883036f74e241a548d31340440df9 (diff) | |
| download | puppet-1d23013abf9e8db5aa405c87ac6657df3f050926.tar.gz puppet-1d23013abf9e8db5aa405c87ac6657df3f050926.tar.xz puppet-1d23013abf9e8db5aa405c87ac6657df3f050926.zip | |
Fixing #605 -- providers now refer to @resource or @resource_type.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2501 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet/provider/zone')
| -rw-r--r-- | lib/puppet/provider/zone/solaris.rb | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/lib/puppet/provider/zone/solaris.rb b/lib/puppet/provider/zone/solaris.rb index d92a774c1..7ace69047 100644 --- a/lib/puppet/provider/zone/solaris.rb +++ b/lib/puppet/provider/zone/solaris.rb @@ -26,8 +26,8 @@ Puppet::Type.type(:zone).provide(:solaris) do hash = line2hash(line) obj = nil - unless obj = @model[hash[:name]] - obj = @model.create(:name => hash[:name]) + unless obj = @resource[hash[:name]] + obj = @resource.create(:name => hash[:name]) end obj.setstatus(hash) @@ -41,11 +41,11 @@ Puppet::Type.type(:zone).provide(:solaris) do # If the thing is entirely absent, then we need to create the config. str = %{create -b set zonepath=%s -} % @model[:path] +} % @resource[:path] # Then perform all of our configuration steps. It's annoying - # that we need this much internal info on the model. - @model.send(:properties).each do |property| + # that we need this much internal info on the resource. + @resource.send(:properties).each do |property| if property.is_a? ZoneConfigProperty and ! property.insync? str += property.configtext + "\n" end @@ -125,8 +125,8 @@ set zonepath=%s # Execute a configuration string. Can't be private because it's called # by the properties. def setconfig(str) - command = "#{command(:cfg)} -z %s -f -" % @model[:name] - debug "Executing '%s' in zone %s with '%s'" % [command, @model[:name], str] + command = "#{command(:cfg)} -z %s -f -" % @resource[:name] + debug "Executing '%s' in zone %s with '%s'" % [command, @resource[:name], str] IO.popen(command, "w") do |pipe| pipe.puts str end @@ -138,8 +138,8 @@ set zonepath=%s def start # Check the sysidcfg stuff - if cfg = @model[:sysidcfg] - path = File.join(@model[:path], "root", "etc", "sysidcfg") + if cfg = @resource[:sysidcfg] + path = File.join(@resource[:path], "root", "etc", "sysidcfg") unless File.exists?(path) begin @@ -161,7 +161,7 @@ set zonepath=%s # Return a hash of the current status of this zone. def statushash begin - output = adm "-z", @model[:name], :list, "-p" + output = adm "-z", @resource[:name], :list, "-p" rescue Puppet::ExecutionFailure return nil end @@ -185,7 +185,7 @@ set zonepath=%s def zoneadm(*cmd) begin - adm("-z", @model[:name], *cmd) + adm("-z", @resource[:name], *cmd) rescue Puppet::ExecutionFailure => detail self.fail "Could not %s zone: %s" % [cmd[0], detail] end @@ -193,7 +193,7 @@ set zonepath=%s def zonecfg(*cmd) begin - cfg("-z", @model[:name], *cmd) + cfg("-z", @resource[:name], *cmd) rescue Puppet::ExecutionFailure => detail self.fail "Could not %s zone: %s" % [cmd[0], detail] end |
