summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2005-05-11 00:19:33 +0000
committerLuke Kanies <luke@madstop.com>2005-05-11 00:19:33 +0000
commit817f5711bf802d88d7b4fba6cdb3d7bd483faa41 (patch)
treefcd9a9fd1aa347f6a401cf34297b89520701e6dd
parent2cce619fae89f99a38ef0bfd6d271407e96d3430 (diff)
downloadpuppet-817f5711bf802d88d7b4fba6cdb3d7bd483faa41.tar.gz
puppet-817f5711bf802d88d7b4fba6cdb3d7bd483faa41.tar.xz
puppet-817f5711bf802d88d7b4fba6cdb3d7bd483faa41.zip
adding lots of verbosity, and starting to actually make sure things execute -- tests are failing, tho
git-svn-id: https://reductivelabs.com/svn/puppet/library/trunk@238 980ebf18-57e1-0310-9a29-db15c13687c0
-rw-r--r--lib/blink/client.rb13
-rw-r--r--lib/blink/transaction.rb7
-rw-r--r--lib/blink/type.rb9
-rw-r--r--lib/blink/type/state.rb5
4 files changed, 28 insertions, 6 deletions
diff --git a/lib/blink/client.rb b/lib/blink/client.rb
index 70d41f8d4..361301181 100644
--- a/lib/blink/client.rb
+++ b/lib/blink/client.rb
@@ -28,18 +28,24 @@ module Blink
end
def objects=(list)
- objects = list.collect { |object|
+ objects = []
+ list.collect { |object|
+ Blink.verbose "object %s" % [object]
# create a Blink object from the list...
#puts "yayness"
if type = Blink::Type.type(object.type)
namevar = type.namevar
- #puts object.inspect
+ puts object.inspect
if namevar != :name
object[namevar] = object[:name]
object.delete(:name)
end
+ puts object.inspect
begin
- type.new(object)
+ puts object.inspect
+ typeobj = type.new(object)
+ Blink.verbose "object %s is %s" % [object,typeobj]
+ objects.push typeobj
rescue => detail
puts "Failed to create object: %s" % detail
puts object.class
@@ -50,6 +56,7 @@ module Blink
raise "Could not find object type %s" % object.type
end
}
+ Blink.verbose "object length is %s" % objects.length
# okay, we have a list of all of the objects we're supposed
# to execute
diff --git a/lib/blink/transaction.rb b/lib/blink/transaction.rb
index d6207f71c..9ff4ea95d 100644
--- a/lib/blink/transaction.rb
+++ b/lib/blink/transaction.rb
@@ -21,6 +21,7 @@ class Blink::Transaction
# for now, just store the changes for executing linearly
# later, we might execute them as we receive them
def change(change)
+ Blink.notice "adding change"
@changes.push change
end
#---------------------------------------------------------------
@@ -37,6 +38,7 @@ class Blink::Transaction
#---------------------------------------------------------------
def initialize(tree)
+ Blink.notice "tree is %s" % [tree]
@tree = tree
@collect = true
@changes = []
@@ -46,13 +48,16 @@ class Blink::Transaction
#---------------------------------------------------------------
def run
if @tree.is_a?(Array)
+ Blink.notice "running array transaction"
@tree.each { |item|
item.evaluate(self)
}
else
+ Blink.notice "running transaction"
@tree.evaluate(self)
end
- self.evaluate
+ Blink.notice "[%s]" % [@changes]
+ #self.evaluate
end
#---------------------------------------------------------------
end
diff --git a/lib/blink/type.rb b/lib/blink/type.rb
index f973c93f3..0541c5e8d 100644
--- a/lib/blink/type.rb
+++ b/lib/blink/type.rb
@@ -462,7 +462,14 @@ class Blink::Type < Blink::Element
# we always descend into the children before we evaluate our current
# states
def evaluate(transaction)
- self.each { |child| child.evaluate(transaction) }
+ self.each { |child|
+ if child.is_a?(Blink::State)
+ Blink.verbose "Got state"
+ else
+ Blink.verbose "type is %s" % self.class
+ end
+ child.evaluate(transaction)
+ }
end
#---------------------------------------------------------------
diff --git a/lib/blink/type/state.rb b/lib/blink/type/state.rb
index 8433cec6d..04b45b246 100644
--- a/lib/blink/type/state.rb
+++ b/lib/blink/type/state.rb
@@ -35,8 +35,11 @@ class Blink::State < Blink::Element
# which will demonstrably not work with states that are part of a larger
# whole, like FileRecordStates
def evaluate(transaction)
+ Blink.verbose "evaluating %s" % self
self.retrieve
- unless self.insync?
+ if self.insync?
+ Blink.verbose "%s is in sync" % self
+ else
transaction.change(Blink::StateChange.new(self))
end
end