summaryrefslogtreecommitdiffstats
path: root/lib/puppet/network/client
diff options
context:
space:
mode:
authorMarkus Roberts <Markus@reality.com>2009-12-21 15:10:40 -0800
committerJames Turnbull <james@lovedthanlost.net>2009-12-23 19:22:56 +1100
commite04f9e4823208e2d8a48ecc25fdf5152ed09ae77 (patch)
treeec9a8516144835fc98c834c61478476f40efd5a0 /lib/puppet/network/client
parent24654a22c2d172b23cb1133f65da4e5a2801de0a (diff)
downloadpuppet-e04f9e4823208e2d8a48ecc25fdf5152ed09ae77.tar.gz
puppet-e04f9e4823208e2d8a48ecc25fdf5152ed09ae77.tar.xz
puppet-e04f9e4823208e2d8a48ecc25fdf5152ed09ae77.zip
Code smell reductions
These are a grab-bag of code simplification changes I made in the process of figuring out what was going on with #2881; they should all be absolutely behavior neutral.
Diffstat (limited to 'lib/puppet/network/client')
-rw-r--r--lib/puppet/network/client/resource.rb17
1 files changed, 2 insertions, 15 deletions
diff --git a/lib/puppet/network/client/resource.rb b/lib/puppet/network/client/resource.rb
index bc4a8e53f..ad3210603 100644
--- a/lib/puppet/network/client/resource.rb
+++ b/lib/puppet/network/client/resource.rb
@@ -27,25 +27,12 @@ class Puppet::Network::Client::Resource < Puppet::Network::Client
def describe(type, name, retrieve = false, ignore = false)
Puppet.info "Describing %s[%s]" % [type.to_s.capitalize, name]
text = @driver.describe(type, name, retrieve, ignore, "yaml")
-
- object = nil
- if @local
- object = text
- else
- object = YAML::load(Base64.decode64(text))
- end
-
- return object
+ @local ? text : YAML::load(Base64.decode64(text))
end
def list(type, ignore = false, base = false)
bucket = @driver.list(type, ignore, base, "yaml")
-
- unless @local
- bucket = YAML::load(Base64.decode64(bucket))
- end
-
- return bucket
+ @local ? bucket : YAML::load(Base64.decode64(bucket))
end
end