diff options
Diffstat (limited to 'lib/puppet/network/handler')
| -rwxr-xr-x | lib/puppet/network/handler/fileserver.rb | 18 | ||||
| -rw-r--r-- | lib/puppet/network/handler/master.rb | 12 |
2 files changed, 5 insertions, 25 deletions
diff --git a/lib/puppet/network/handler/fileserver.rb b/lib/puppet/network/handler/fileserver.rb index cb54ca4e4..b7a0c1387 100755 --- a/lib/puppet/network/handler/fileserver.rb +++ b/lib/puppet/network/handler/fileserver.rb @@ -92,11 +92,7 @@ class Puppet::Network::Handler @mounts = {} @files = {} - if hash[:Local] - @local = hash[:Local] - else - @local = false - end + @local = hash[:Local] @noreadconfig = true if hash[:Config] == false @@ -236,18 +232,10 @@ class Puppet::Network::Handler unless hostname = (client || Facter.value("hostname")) raise ArgumentError, "Could not find hostname" end - if node = Puppet::Node.find(hostname) - env = node.environment - else - env = nil - end + env = (node = Puppet::Node.find(hostname)) ? node.environment : nil # And use the environment to look up the module. - if mod = Puppet::Node::Environment.new(env).module(module_name) and mod.files? - return @mounts[MODULES].copy(mod.name, mod.file_directory) - else - return nil - end + return (mod = Puppet::Node::Environment.new(env).module(module_name) and mod.files?) ? @mounts[MODULES].copy(mod.name, mod.file_directory) : nil end # Read the configuration file. diff --git a/lib/puppet/network/handler/master.rb b/lib/puppet/network/handler/master.rb index d55046b5b..690e7079e 100644 --- a/lib/puppet/network/handler/master.rb +++ b/lib/puppet/network/handler/master.rb @@ -29,19 +29,11 @@ class Puppet::Network::Handler def initialize(hash = {}) args = {} - if hash[:Local] - @local = hash[:Local] - else - @local = false - end + @local = hash[:Local] args[:Local] = true - if hash.include?(:CA) and hash[:CA] - @ca = Puppet::SSLCertificates::CA.new() - else - @ca = nil - end + @ca = (hash.include?(:CA) and hash[:CA]) ? Puppet::SSLCertificates::CA.new() : nil # This is only used by the cfengine module, or if --loadclasses was # specified in +puppet+. |
