summaryrefslogtreecommitdiffstats
path: root/lib/puppet/client.rb
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2005-06-27 21:47:06 +0000
committerLuke Kanies <luke@madstop.com>2005-06-27 21:47:06 +0000
commit60783f0777eb5dd89d44a8dfd2ced49f06a32d8f (patch)
treed1cf67771de26cd49d98fff28d2e7aa89cbf63e0 /lib/puppet/client.rb
parent8f95084cd854aef4e3493854e58cefd352cdc68d (diff)
downloadpuppet-60783f0777eb5dd89d44a8dfd2ced49f06a32d8f.tar.gz
puppet-60783f0777eb5dd89d44a8dfd2ced49f06a32d8f.tar.xz
puppet-60783f0777eb5dd89d44a8dfd2ced49f06a32d8f.zip
renaming blink to puppet
git-svn-id: https://reductivelabs.com/svn/puppet/library/trunk@305 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet/client.rb')
-rw-r--r--lib/puppet/client.rb44
1 files changed, 22 insertions, 22 deletions
diff --git a/lib/puppet/client.rb b/lib/puppet/client.rb
index f266d2dfb..f1140ea4d 100644
--- a/lib/puppet/client.rb
+++ b/lib/puppet/client.rb
@@ -4,19 +4,19 @@
# the available clients
-require 'blink'
-require 'blink/function'
-require 'blink/type'
-require 'blink/fact'
-require 'blink/transaction'
-require 'blink/transportable'
+require 'puppet'
+require 'puppet/function'
+require 'puppet/type'
+require 'puppet/fact'
+require 'puppet/transaction'
+require 'puppet/transportable'
require 'http-access2'
require 'soap/rpc/driver'
require 'soap/rpc/httpserver'
#require 'webrick/https'
require 'logger'
-module Blink
+module Puppet
class ClientError < RuntimeError; end
#---------------------------------------------------------------
class Client < SOAP::RPC::HTTPServer
@@ -26,19 +26,19 @@ module Blink
@nil = nil
@url = hash[:Server]
if hash.include?(:Listen) and hash[:Listen] == false
- Blink.notice "We're a local client"
+ Puppet.notice "We're a local client"
@localonly = true
@driver = @url
else
- Blink.notice "We're a networked client"
+ Puppet.notice "We're a networked client"
@localonly = false
- @driver = SOAP::RPC::Driver.new(@url, 'urn:blink-server')
+ @driver = SOAP::RPC::Driver.new(@url, 'urn:puppet-server')
@driver.add_method("getconfig", "name")
end
unless @localonly
hash.delete(:Server)
- Blink.notice "Server is %s" % @url
+ Puppet.notice "Server is %s" % @url
hash[:BindAddress] ||= "0.0.0.0"
hash[:Port] ||= 17444
@@ -50,14 +50,14 @@ module Blink
end
def getconfig
- Blink.debug "server is %s" % @url
+ Puppet.debug "server is %s" % @url
#client.loadproperty('files/sslclient.properties')
- Blink.notice("getting config")
+ Puppet.notice("getting config")
objects = nil
if @localonly
objects = @driver.getconfig(self)
else
- objects = @driver.getconfig(Blink::Fact["hostname"])
+ objects = @driver.getconfig(Puppet::Fact["hostname"])
end
self.config(objects)
end
@@ -67,28 +67,28 @@ module Blink
# for now, just descend into the tree and perform and necessary
# manipulations
def config(tree)
- Blink.notice("Calling config")
+ Puppet.notice("Calling config")
container = Marshal::load(tree).to_type
# this is a gross hack... but i don't see a good way around it
# set all of the variables to empty
- Blink::Transaction.init
+ Puppet::Transaction.init
# for now we just evaluate the top-level container, but eventually
# there will be schedules and such associated with each object,
# and probably with the container itself
transaction = container.evaluate
- #transaction = Blink::Transaction.new(objects)
+ #transaction = Puppet::Transaction.new(objects)
transaction.toplevel = true
transaction.evaluate
self.shutdown
end
def callfunc(name,args)
- Blink.notice("Calling callfunc on %s" % name)
- if function = Blink::Function[name]
- #Blink.debug("calling function %s" % function)
+ Puppet.notice("Calling callfunc on %s" % name)
+ if function = Puppet::Function[name]
+ #Puppet.debug("calling function %s" % function)
value = function.call(args)
- #Blink.debug("from %s got %s" % [name,value])
+ #Puppet.debug("from %s got %s" % [name,value])
return value
else
raise "Function '%s' not found" % name
@@ -98,7 +98,7 @@ module Blink
private
def on_init
- @default_namespace = 'urn:blink-client'
+ @default_namespace = 'urn:puppet-client'
add_method(self, 'config', 'config')
add_method(self, 'callfunc', 'name', 'arguments')
end