diff options
Diffstat (limited to 'lib/puppet/network')
| -rw-r--r-- | lib/puppet/network/format.rb | 3 | ||||
| -rwxr-xr-x | lib/puppet/network/handler/fileserver.rb | 18 | ||||
| -rw-r--r-- | lib/puppet/network/handler/master.rb | 12 | ||||
| -rw-r--r-- | lib/puppet/network/http/api/v1.rb | 3 | ||||
| -rw-r--r-- | lib/puppet/network/http/compression.rb | 3 | ||||
| -rwxr-xr-x | lib/puppet/network/rights.rb | 3 |
6 files changed, 9 insertions, 33 deletions
diff --git a/lib/puppet/network/format.rb b/lib/puppet/network/format.rb index fb5a74a1c..243671d1c 100644 --- a/lib/puppet/network/format.rb +++ b/lib/puppet/network/format.rb @@ -106,7 +106,6 @@ class Puppet::Network::Format method = send(name) - return klass.respond_to?(method) if type == :class - return klass.instance_methods.include?(method) + return(type == :class ? klass.respond_to?(method) : klass.instance_methods.include?(method)) end end 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+. diff --git a/lib/puppet/network/http/api/v1.rb b/lib/puppet/network/http/api/v1.rb index 347da93a6..265b297ec 100644 --- a/lib/puppet/network/http/api/v1.rb +++ b/lib/puppet/network/http/api/v1.rb @@ -49,8 +49,7 @@ module Puppet::Network::HTTP::API::V1 end def pluralize(indirection) - return "statuses" if indirection == "status" - return indirection + "s" + return(indirection == "status" ? "statuses" : indirection + "s") end def plurality(indirection) diff --git a/lib/puppet/network/http/compression.rb b/lib/puppet/network/http/compression.rb index 722ecfe24..923262b98 100644 --- a/lib/puppet/network/http/compression.rb +++ b/lib/puppet/network/http/compression.rb @@ -5,8 +5,7 @@ module Puppet::Network::HTTP::Compression # this module function allows to use the right underlying # methods depending on zlib presence def module - return Active if Puppet.features.zlib? - return None + return(Puppet.features.zlib? ? Active : None) end module_function :module diff --git a/lib/puppet/network/rights.rb b/lib/puppet/network/rights.rb index 509a9231b..2c781b390 100755 --- a/lib/puppet/network/rights.rb +++ b/lib/puppet/network/rights.rb @@ -258,8 +258,7 @@ class Rights end def ==(name) - return self.key == namespace_to_key(name) if acl_type == :name - return self.name == name.gsub(/^~\s+/,'') + return(acl_type == :name ? self.key == namespace_to_key(name) : self.name == name.gsub(/^~\s+/,'')) end end |
