diff options
author | Luke Kanies <luke@madstop.com> | 2005-05-16 17:09:08 +0000 |
---|---|---|
committer | Luke Kanies <luke@madstop.com> | 2005-05-16 17:09:08 +0000 |
commit | f9a223cdbebb43b4df527cae0c34a0ce938c02d6 (patch) | |
tree | 542b451b6511b1776c3b5e0d8766554e4ad1cde9 /lib/blink/client.rb | |
parent | 00a620de88c593ffe841121c3a2e19504380b669 (diff) | |
download | puppet-f9a223cdbebb43b4df527cae0c34a0ce938c02d6.tar.gz puppet-f9a223cdbebb43b4df527cae0c34a0ce938c02d6.tar.xz puppet-f9a223cdbebb43b4df527cae0c34a0ce938c02d6.zip |
transformations from the client through to the transactional execution now works!
git-svn-id: https://reductivelabs.com/svn/puppet/library/trunk@251 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/blink/client.rb')
-rw-r--r-- | lib/blink/client.rb | 53 |
1 files changed, 14 insertions, 39 deletions
diff --git a/lib/blink/client.rb b/lib/blink/client.rb index 014e2a33f..0c4c59bcf 100644 --- a/lib/blink/client.rb +++ b/lib/blink/client.rb @@ -8,6 +8,7 @@ require 'blink' require 'blink/function' require 'blink/type' require 'blink/transaction' +require 'blink/transportable' module Blink class ClientError < RuntimeError; end @@ -27,45 +28,19 @@ module Blink end end - def objects=(list) - objects = [] - list.collect { |object| - # create a Blink object from the list... - #puts "yayness" - if type = Blink::Type.type(object.type) - namevar = type.namevar - if namevar != :name - object[namevar] = object[:name] - object.delete(:name) - end - begin - # this will fail if the type already exists - # which may or may not be a good thing... - typeobj = type.new(object) - objects.push typeobj - rescue => detail - puts "Failed to create object: %s" % detail - #puts object.class - #puts object.inspect - exit - end - else - raise "Could not find object type %s" % object.type - end - } - - # okay, we have a list of all of the objects we're supposed - # to execute - # here's where we collect the rollbacks and record them - # that means that we need, at the least: - # - a standard mechanism for specifying that an object is no-op - # - a standard object that is considered a rollback object - #objects.each { |obj| - # obj.evaluate - #} - - transaction = Blink::Transaction.new(objects) - transaction.run + # this method is how the client receives the tree of Transportable + # objects + # for now, just descend into the tree and perform and necessary + # manipulations + def objects=(tree) + container = tree.to_type + + # 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.evaluate end end end |