Mailinglist Archive: yast-devel (152 mails)

< Previous Next >
[yast-devel] Re: [yast-commit] <rest-service> master : fix concerning limits
  • From: josef reidinger <jreidinger@xxxxxxx>
  • Date: Fri, 17 Jul 2009 10:29:32 +0200
  • Message-id: <4A60366C.20301@xxxxxxx>
Stefan Schubert napsal(a):
ref: refs/heads/master
commit f90bd649630a76cb31629c7bd99d0b1d0aeabea3
Author: Stefan Schubert <schubi@xxxxxxx>
Date: Fri Jul 17 10:23:16 2009 +0200

fix concerning limits
---
plugins/status/app/models/status.rb | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/plugins/status/app/models/status.rb
b/plugins/status/app/models/status.rb
index 95136ea..a31ef24 100644
--- a/plugins/status/app/models/status.rb
+++ b/plugins/status/app/models/status.rb
@@ -164,7 +164,10 @@ class Status < ActiveRecord::Base

#setting the limits
result.each do |key, value|
- path = rrdfile.chomp(".rrd") + "/" + key
+
+ path = rrdfile.chomp(".rrd")
+ path +="/" + key if key!="value" #do not take care about the value
flag
+ path = path.tr('-','_')
^^^ Hint, ruby has for this purpose ! version of opration, so
path.tr!('-','_') is better (more DRY :)
if @limits.has_key?(path)
result[key] ||= Hash.new
result[key].merge!({"limit" => @limits[path] })

--
To unsubscribe, e-mail: yast-devel+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-devel+help@xxxxxxxxxxxx

< Previous Next >
Follow Ups