summaryrefslogtreecommitdiffstats
path: root/lib/puppet/network/handler
diff options
context:
space:
mode:
authorJames Turnbull <james@lovedthanlost.net>2009-02-26 11:43:39 +1100
committerJames Turnbull <james@lovedthanlost.net>2009-02-26 11:43:39 +1100
commit5f73eb553fd083b558fb9553b0c07b6019d0ccee (patch)
tree123ef2a9c7b8aa4e1cd52e6b98d0b3c53d626de6 /lib/puppet/network/handler
parente40aea3c655e698d26c29370227b52c489e6db2b (diff)
downloadpuppet-5f73eb553fd083b558fb9553b0c07b6019d0ccee.tar.gz
puppet-5f73eb553fd083b558fb9553b0c07b6019d0ccee.tar.xz
puppet-5f73eb553fd083b558fb9553b0c07b6019d0ccee.zip
Fixed #1849 - Ruby 1.9 portability: `when' doesn't like colons, replace with semicolons
Diffstat (limited to 'lib/puppet/network/handler')
-rwxr-xr-xlib/puppet/network/handler/fileserver.rb14
-rw-r--r--lib/puppet/network/handler/master.rb4
-rwxr-xr-xlib/puppet/network/handler/resource.rb6
3 files changed, 12 insertions, 12 deletions
diff --git a/lib/puppet/network/handler/fileserver.rb b/lib/puppet/network/handler/fileserver.rb
index b39396091..86b0b5bb6 100755
--- a/lib/puppet/network/handler/fileserver.rb
+++ b/lib/puppet/network/handler/fileserver.rb
@@ -278,9 +278,9 @@ class Puppet::Network::Handler
count = 1
f.each { |line|
case line
- when /^\s*#/: next # skip comments
- when /^\s*$/: next # skip blank lines
- when /\[([-\w]+)\]/:
+ when /^\s*#/; next # skip comments
+ when /^\s*$/; next # skip blank lines
+ when /\[([-\w]+)\]/
name = $1
if newmounts.include?(name)
raise FileServerError, "%s is already mounted at %s" %
@@ -288,11 +288,11 @@ class Puppet::Network::Handler
end
mount = Mount.new(name)
newmounts[name] = mount
- when /^\s*(\w+)\s+(.+)$/:
+ when /^\s*(\w+)\s+(.+)$/
var = $1
value = $2
case var
- when "path":
+ when "path"
if mount.name == MODULES
Puppet.warning "The '#{mount.name}' module can not have a path. Ignoring attempt to set it"
else
@@ -304,7 +304,7 @@ class Puppet::Network::Handler
newmounts.delete(mount.name)
end
end
- when "allow":
+ when "allow"
value.split(/\s*,\s*/).each { |val|
begin
mount.info "allowing %s access" % val
@@ -314,7 +314,7 @@ class Puppet::Network::Handler
count, @configuration.file)
end
}
- when "deny":
+ when "deny"
value.split(/\s*,\s*/).each { |val|
begin
mount.info "denying %s access" % val
diff --git a/lib/puppet/network/handler/master.rb b/lib/puppet/network/handler/master.rb
index 7bde0af73..0d36c1e88 100644
--- a/lib/puppet/network/handler/master.rb
+++ b/lib/puppet/network/handler/master.rb
@@ -65,9 +65,9 @@ class Puppet::Network::Handler
catalog = Puppet::Resource::Catalog.find(client)
case format
- when "yaml":
+ when "yaml"
return CGI.escape(catalog.extract.to_yaml(:UseBlock => true))
- when "marshal":
+ when "marshal"
return CGI.escape(Marshal.dump(catalog.extract))
else
raise "Invalid markup format '%s'" % format
diff --git a/lib/puppet/network/handler/resource.rb b/lib/puppet/network/handler/resource.rb
index e7ecbbdf2..54391c3de 100755
--- a/lib/puppet/network/handler/resource.rb
+++ b/lib/puppet/network/handler/resource.rb
@@ -29,7 +29,7 @@ class Puppet::Network::Handler
unless local?
begin
case format
- when "yaml":
+ when "yaml"
bucket = YAML::load(Base64.decode64(bucket))
else
raise Puppet::Error, "Unsupported format '%s'" % format
@@ -99,7 +99,7 @@ class Puppet::Network::Handler
unless @local
case format
- when "yaml":
+ when "yaml"
trans = Base64.encode64(YAML::dump(trans))
else
raise XMLRPC::FaultException.new(
@@ -143,7 +143,7 @@ class Puppet::Network::Handler
unless @local
case format
- when "yaml":
+ when "yaml"
begin
bucket = Base64.encode64(YAML::dump(bucket))
rescue => detail