summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Gerus <arachnist@i.am-a.cat>2013-09-01 21:59:13 +0200
committerRobert Gerus <arachnist@i.am-a.cat>2013-09-01 21:59:13 +0200
commit02aade1618662e9e4db52e645f63928d0da3f88f (patch)
tree729447aa77328bc13cc02b58143211c01a580f3a
parente4b5b1d2adba4ed43d7b5a6350c8f61f53de068e (diff)
downloadzvolcreator-02aade1618662e9e4db52e645f63928d0da3f88f.tar.gz
zvolcreator-02aade1618662e9e4db52e645f63928d0da3f88f.tar.bz2
zvolcreator-02aade1618662e9e4db52e645f63928d0da3f88f.zip
Close connection after volume creation.
-rwxr-xr-xzvolcreator.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/zvolcreator.rb b/zvolcreator.rb
index 5f51572..e811d1f 100755
--- a/zvolcreator.rb
+++ b/zvolcreator.rb
@@ -50,6 +50,7 @@ loop do
volpath = userfs + "/" + uuid.generate
ZFS(volpath).create(:sparse => true, :volume => response["content"]["volsize"])
client.puts({:status => 0, :content => {:volpath => volpath}}.to_json)
+ client.close
rescue JSON::ParserError, ArgumentError => e
puts "Error: #{e.to_s}"
client.puts({:status => 1, :content => e.to_s})