summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Gerus <arachnist@i.am-a.cat>2013-09-01 21:58:18 +0200
committerRobert Gerus <arachnist@i.am-a.cat>2013-09-01 21:58:18 +0200
commite4b5b1d2adba4ed43d7b5a6350c8f61f53de068e (patch)
treeee3ebdbd6d2428cecc9d9b900996d138d3e9dad2
parentf933839257915bcc6b902df77b5e196210258f5a (diff)
downloadzvolcreator-e4b5b1d2adba4ed43d7b5a6350c8f61f53de068e.tar.gz
zvolcreator-e4b5b1d2adba4ed43d7b5a6350c8f61f53de068e.tar.bz2
zvolcreator-e4b5b1d2adba4ed43d7b5a6350c8f61f53de068e.zip
Reading by line, with gets, is more suitable for us.
-rwxr-xr-xzvolcreator.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/zvolcreator.rb b/zvolcreator.rb
index fb7de12..5f51572 100755
--- a/zvolcreator.rb
+++ b/zvolcreator.rb
@@ -30,13 +30,13 @@ loop do
uuid = UUID.new
puts "Sending our greeting"
client.puts({:status => 0, :content => {:app => "zvolcreator", :apiversion => 0}}.to_json)
- response = JSON.parse(client.read)
+ response = JSON.parse(client.gets)
puts "Client response: #{response}"
raise ArgumentError.new("Bad status") if response["status"] != 0
puts "Sending basic server info"
client.puts({:status => 0, :content => {:basefs => Config[:basefs], :default_user_quota => Config[:default_user_quota]}}.to_json)
- response = JSON.parse(client.read)
+ response = JSON.parse(client.gets)
puts "Client response: #{response}"
raise ArgumentError.new("Bad status") if response["status"] != 0
raise ArgumentError.new("No user specified") if not response["content"]["user"]