diff options
Diffstat (limited to 'lib/puppet/file_serving')
-rw-r--r-- | lib/puppet/file_serving/base.rb | 2 | ||||
-rw-r--r-- | lib/puppet/file_serving/configuration/parser.rb | 19 | ||||
-rw-r--r-- | lib/puppet/file_serving/metadata.rb | 23 | ||||
-rw-r--r-- | lib/puppet/file_serving/mount/file.rb | 5 |
4 files changed, 27 insertions, 22 deletions
diff --git a/lib/puppet/file_serving/base.rb b/lib/puppet/file_serving/base.rb index a7ab9b66e..3543df8d7 100644 --- a/lib/puppet/file_serving/base.rb +++ b/lib/puppet/file_serving/base.rb @@ -86,7 +86,7 @@ class Puppet::FileServing::Base 'metadata' => { 'api_version' => 1 } - } + } end end diff --git a/lib/puppet/file_serving/configuration/parser.rb b/lib/puppet/file_serving/configuration/parser.rb index eef2d7852..d8bf30477 100644 --- a/lib/puppet/file_serving/configuration/parser.rb +++ b/lib/puppet/file_serving/configuration/parser.rb @@ -36,12 +36,10 @@ class Puppet::FileServing::Configuration::Parser < Puppet::Util::LoadedFile when "deny" deny(mount, value) else - raise ArgumentError.new("Invalid argument '%s'" % var, - @count, file) + raise ArgumentError.new("Invalid argument '%s'" % var, @count, file) end else - raise ArgumentError.new("Invalid line '%s'" % line.chomp, - @count, file) + raise ArgumentError.new("Invalid line '%s'" % line.chomp, @count, file) end } } @@ -61,7 +59,10 @@ class Puppet::FileServing::Configuration::Parser < Puppet::Util::LoadedFile mount.info "allowing %s access" % val mount.allow(val) rescue AuthStoreError => detail - raise ArgumentError.new(detail.to_s, + + raise ArgumentError.new( + detail.to_s, + @count, file) end } @@ -75,7 +76,10 @@ class Puppet::FileServing::Configuration::Parser < Puppet::Util::LoadedFile mount.info "denying %s access" % val mount.deny(val) rescue AuthStoreError => detail - raise ArgumentError.new(detail.to_s, + + raise ArgumentError.new( + detail.to_s, + @count, file) end } @@ -84,8 +88,7 @@ class Puppet::FileServing::Configuration::Parser < Puppet::Util::LoadedFile # Create a new mount. def newmount(name) if @mounts.include?(name) - raise ArgumentError, "%s is already mounted at %s" % - [@mounts[name], name], @count, file + raise ArgumentError, "%s is already mounted at %s" % [@mounts[name], name], @count, file end case name when "modules" diff --git a/lib/puppet/file_serving/metadata.rb b/lib/puppet/file_serving/metadata.rb index 6790c1a78..848a5f963 100644 --- a/lib/puppet/file_serving/metadata.rb +++ b/lib/puppet/file_serving/metadata.rb @@ -87,29 +87,32 @@ class Puppet::FileServing::Metadata < Puppet::FileServing::Base def to_pson_data_hash { 'document_type' => 'FileMetadata', - 'data' => super['data'].update({ - 'owner' => owner, - 'group' => group, - 'mode' => mode, - 'checksum' => { - 'type' => checksum_type, - 'value' => checksum + + 'data' => super['data'].update( + { + 'owner' => owner, + 'group' => group, + 'mode' => mode, + 'checksum' => { + 'type' => checksum_type, + 'value' => checksum }, 'type' => ftype, 'destination' => destination, + }), 'metadata' => { 'api_version' => 1 } - } + } end def to_pson(*args) - to_pson_data_hash.to_pson(*args) + to_pson_data_hash.to_pson(*args) end def self.from_pson(data) - new(data.delete('path'), data) + new(data.delete('path'), data) end end diff --git a/lib/puppet/file_serving/mount/file.rb b/lib/puppet/file_serving/mount/file.rb index e1eaf6052..8a619e962 100644 --- a/lib/puppet/file_serving/mount/file.rb +++ b/lib/puppet/file_serving/mount/file.rb @@ -96,8 +96,7 @@ class Puppet::FileServing::Mount::File < Puppet::FileServing::Mount if node map = clientmap(node) else - Puppet.notice "No client; expanding '%s' with local host" % - path + Puppet.notice "No client; expanding '%s' with local host" % path # Else, use the local information map = localmap() end @@ -114,7 +113,7 @@ class Puppet::FileServing::Mount::File < Puppet::FileServing::Mount # Do we have any patterns in our path, yo? def expandable? - if defined? @expandable + if defined?(@expandable) @expandable else false |