diff options
author | Luke Kanies <luke@madstop.com> | 2007-09-15 22:17:20 -0600 |
---|---|---|
committer | Luke Kanies <luke@madstop.com> | 2007-09-15 22:17:20 -0600 |
commit | f17f19dae941b17a56c1fc83ed3a89712b98c427 (patch) | |
tree | 3615e9be9ed585511bbe0b85737208bbd85f00f0 /lib/puppet/network/handler | |
parent | 3ccf483f77b026dde8a53bd8e9dff6a5fd0f6722 (diff) | |
download | puppet-f17f19dae941b17a56c1fc83ed3a89712b98c427.tar.gz puppet-f17f19dae941b17a56c1fc83ed3a89712b98c427.tar.xz puppet-f17f19dae941b17a56c1fc83ed3a89712b98c427.zip |
The whole system now uses Configuration objects instead of
ever converting the Transportable objects into a tree of components
and then converting that into a graph. This is a significant
step, and drastically simplifies the model of how to use a configuration.
The old code might have looked something like this:
file = Puppet::Type.create :path => "/whatever", ...
comp = Puppet::Type.create :name => :whatever
comp.push file
transaction = comp.evaluate
transaction.evaluate
The new code looks like this:
file = Puppet::Type.create :path => "/whatever", ...
config = Puppet::Node::Configuration.new
config.add_resource file
config.apply
I did not really intend to do this much refactoring, but I
found I could not use a Configuration object to do work
without refactoring a lot of the system. The primary problem
was that the Client::Master and the Config classes determined
how the transactions behaved; when I moved to using a Configuration,
this distinction was lost, which meant that configurations were
often needing to create other configurations, which resulted in
a whole lot of infinite recursion (e.g., Config objects that create
directories for Puppet use Configuration objects -- yes, I'm
s/Config/Settings/g soon -- and these Configuration objects would
need to create directories).
Not everything is fixed, but it's very close. I am clearly over
the hump, though, so I wanted to get a commit in.
Diffstat (limited to 'lib/puppet/network/handler')
-rwxr-xr-x | lib/puppet/network/handler/fileserver.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/puppet/network/handler/fileserver.rb b/lib/puppet/network/handler/fileserver.rb index 993e9d51a..022e0c1d4 100755 --- a/lib/puppet/network/handler/fileserver.rb +++ b/lib/puppet/network/handler/fileserver.rb @@ -243,7 +243,10 @@ class Puppet::Network::Handler # the modules. def modules_mount(module_name, client) # Find our environment, if we have one. - if node = Puppet::Node.get(client || Facter.value("hostname")) + unless hostname = (client || Facter.value("hostname")) + raise ArgumentError, "Could not find hostname" + end + if node = Puppet::Node.get(hostname) env = node.environment else env = nil |