From 6e687abef50539deffd02efa84e264eaa755334b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Fri, 3 Jul 2015 10:41:53 +0200 Subject: [PATCH] Bug #3861: Fix etc file paths for oneacct --- src/cli/one_helper.rb | 6 +++--- src/cli/one_helper/oneacct_helper.rb | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/cli/one_helper.rb b/src/cli/one_helper.rb index e644c3c404..1a76dc888b 100644 --- a/src/cli/one_helper.rb +++ b/src/cli/one_helper.rb @@ -649,13 +649,13 @@ user #{self.rname} of the user identified by the username EOT end - def self.table_conf - path = "#{ENV["HOME"]}/.one/cli/#{self.conf_file}" + def self.table_conf(conf_file=self.conf_file) + path = "#{ENV["HOME"]}/.one/cli/#{conf_file}" if File.exists?(path) return path else - return "#{TABLE_CONF_PATH}/#{self.conf_file}" + return "#{TABLE_CONF_PATH}/#{conf_file}" end end diff --git a/src/cli/one_helper/oneacct_helper.rb b/src/cli/one_helper/oneacct_helper.rb index 00471f0d71..0dbcd0d1b2 100644 --- a/src/cli/one_helper/oneacct_helper.rb +++ b/src/cli/one_helper/oneacct_helper.rb @@ -114,7 +114,7 @@ class AcctHelper < OpenNebulaHelper::OneHelper ACCT_OPTIONS = [START_TIME_ACCT, END_TIME_ACCT, USERFILTER, GROUP, HOST, XPATH, XML, JSON, SPLIT] SHOWBACK_OPTIONS = [START_TIME_SHOWBACK, END_TIME_SHOWBACK, USERFILTER, GROUP, XML, JSON] - ACCT_TABLE = CLIHelper::ShowTable.new("oneacct.yaml", nil) do + ACCT_TABLE = CLIHelper::ShowTable.new(self.table_conf("oneacct.yaml"), nil) do column :UID, "User ID", :size=>4 do |d| d["UID"] end @@ -190,7 +190,7 @@ class AcctHelper < OpenNebulaHelper::OneHelper default :VID, :HOSTNAME, :ACTION, :REASON, :START_TIME, :END_TIME, :MEMORY, :CPU, :NETRX, :NETTX, :TOTAL_DISK_SIZE end - SHOWBACK_TABLE = CLIHelper::ShowTable.new("oneshowback.yaml", nil) do + SHOWBACK_TABLE = CLIHelper::ShowTable.new(self.table_conf("oneshowback.yaml"), nil) do column :UID, "User ID", :size=>4 do |d| d["UID"] end