Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Renaming "remote_resource" to "external_resource"

Signed-off-by: Luke Kanies <luke@reductivelabs.com>
  • Loading branch information...
commit 5bccb4a32604fa38060bdd6ba26605e18dce65d2 1 parent 4b164ee
@lak lak authored
View
2  ext/example.pp
@@ -1,6 +1,6 @@
#!/usr/bin/env puppet --verbose
-remote_resource { "file exists":
+external_resource { "file exists":
frequency => 1,
timeout => 30,
check => "/bin/ls /tmp/myfile"
View
2  lib/puppet/provider/remote_resource/shell.rb
@@ -1,6 +1,6 @@
require 'puppet/util'
-Puppet::Type.type(:remote_resource).provide(:shell) do
+Puppet::Type.type(:external_resource).provide(:shell) do
desc "Check the state of a remote resource using a shell script.
If the script exits with a non-zero code, the resource is considered
to not be up."
View
6 lib/puppet/type/remote_resource.rb
@@ -1,4 +1,4 @@
-Puppet::Type.newtype(:remote_resource) do
+Puppet::Type.newtype(:external_resource) do
newparam(:name) do
desc "The name of the remote resource."
end
@@ -27,7 +27,7 @@
def retrieve
start = Time.now
while true
- return {} if remote_resource_up?
+ return {} if external_resource_up?
if Time.now - start > self[:timeout]
fail "Remote resource not up within timeout #{self[:timeout]}"
end
@@ -39,7 +39,7 @@ def retrieve
private
- def remote_resource_up?
+ def external_resource_up?
begin
provider.perform_check(self[:check])
return true
View
4 spec/unit/provider/remote_resource/shell.rb
@@ -1,9 +1,9 @@
Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f) : Dir.chdir("..") { s.call(f) } }).call("spec/spec_helper.rb") }
-describe Puppet::Type.type(:remote_resource).provider(:shell) do
+describe Puppet::Type.type(:external_resource).provider(:shell) do
before do
@resource = stub 'resource'
- @provider = Puppet::Type.type(:remote_resource).provider(:shell).new(@resource)
+ @provider = Puppet::Type.type(:external_resource).provider(:shell).new(@resource)
end
it "should exist" do
View
4 spec/unit/type/remote_resource.rb
@@ -1,8 +1,8 @@
Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f) : Dir.chdir("..") { s.call(f) } }).call("spec/spec_helper.rb") }
-describe Puppet::Type.type(:remote_resource) do
+describe Puppet::Type.type(:external_resource) do
before do
- @type = Puppet::Type.type(:remote_resource)
+ @type = Puppet::Type.type(:external_resource)
end
it "should exist" do
Please sign in to comment.
Something went wrong with that request. Please try again.