From 798aa3f9ff9f697a1d75e2725ef136768c50ed99 Mon Sep 17 00:00:00 2001 From: Scott Schneider Date: Thu, 9 Apr 2015 12:48:56 -0700 Subject: [PATCH] Ensure 'lifetime' val returned by GET /vm/:hostname is an int --- lib/vmpooler/api/v1.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/vmpooler/api/v1.rb b/lib/vmpooler/api/v1.rb index 1656219..0bab6bc 100644 --- a/lib/vmpooler/api/v1.rb +++ b/lib/vmpooler/api/v1.rb @@ -452,7 +452,7 @@ module Vmpooler result[params[:hostname]] = {} result[params[:hostname]]['template'] = rdata['template'] - result[params[:hostname]]['lifetime'] = rdata['lifetime'] || Vmpooler::API.settings.config[:config]['vm_lifetime'] + result[params[:hostname]]['lifetime'] = (rdata['lifetime'] || Vmpooler::API.settings.config[:config]['vm_lifetime']).to_i if rdata['destroy'] result[params[:hostname]]['running'] = ((Time.parse(rdata['destroy']) - Time.parse(rdata['checkout'])) / 60 / 60).round(2)