mirror of
https://github.com/OpenNebula/one.git
synced 2025-02-10 13:57:22 +03:00
feature #661: Use user table conf file
This commit is contained in:
parent
088dc7ff2a
commit
84acb6d1ca
@ -229,6 +229,16 @@ user #{self.rname} of the user identified by the username
|
|||||||
EOT
|
EOT
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def self.table_conf
|
||||||
|
path = "#{ENV["HOME"]}/.one/cli/#{self.conf_file}"
|
||||||
|
|
||||||
|
if File.exists?(path)
|
||||||
|
return path
|
||||||
|
else
|
||||||
|
return "#{TABLE_CONF_PATH}/#{self.conf_file}"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def retrieve_resource(id)
|
def retrieve_resource(id)
|
||||||
|
@ -17,12 +17,14 @@
|
|||||||
require 'one_helper'
|
require 'one_helper'
|
||||||
|
|
||||||
class OneGroupHelper < OpenNebulaHelper::OneHelper
|
class OneGroupHelper < OpenNebulaHelper::OneHelper
|
||||||
TABLE_CONF_FILE="#{OpenNebulaHelper::TABLE_CONF_PATH}/onegroup.yaml"
|
|
||||||
|
|
||||||
def self.rname
|
def self.rname
|
||||||
"GROUP"
|
"GROUP"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def self.conf_file
|
||||||
|
"onegroup.yaml"
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def factory(id=nil)
|
def factory(id=nil)
|
||||||
@ -40,7 +42,8 @@ class OneGroupHelper < OpenNebulaHelper::OneHelper
|
|||||||
end
|
end
|
||||||
|
|
||||||
def format_pool(pool, options, top=false)
|
def format_pool(pool, options, top=false)
|
||||||
table=CLIHelper::ShowTable.new(TABLE_CONF_FILE, self) do
|
config_file=self.class.table_conf
|
||||||
|
table=CLIHelper::ShowTable.new(config_file, self) do
|
||||||
column :ID, "ONE identifier for the Group", :size=>4 do |d|
|
column :ID, "ONE identifier for the Group", :size=>4 do |d|
|
||||||
d["ID"]
|
d["ID"]
|
||||||
end
|
end
|
||||||
|
@ -70,7 +70,8 @@ class OneHostHelper < OpenNebulaHelper::OneHelper
|
|||||||
end
|
end
|
||||||
|
|
||||||
def format_pool(pool, options, top=false)
|
def format_pool(pool, options, top=false)
|
||||||
table=CLIHelper::ShowTable.new(TABLE_CONF_FILE, self) do
|
config_file=self.class.table_conf
|
||||||
|
table=CLIHelper::ShowTable.new(config_file, self) do
|
||||||
column :ID, "ONE identifier for Host", :size=>4 do |d|
|
column :ID, "ONE identifier for Host", :size=>4 do |d|
|
||||||
d["ID"]
|
d["ID"]
|
||||||
end
|
end
|
||||||
|
@ -59,7 +59,8 @@ class OneImageHelper < OpenNebulaHelper::OneHelper
|
|||||||
end
|
end
|
||||||
|
|
||||||
def format_pool(pool, options, top=false)
|
def format_pool(pool, options, top=false)
|
||||||
table=CLIHelper::ShowTable.new(TABLE_CONF_FILE, self) do
|
config_file=self.class.table_conf
|
||||||
|
table=CLIHelper::ShowTable.new(config_file, self) do
|
||||||
column :ID, "ONE identifier for the Image", :size=>4 do |d|
|
column :ID, "ONE identifier for the Image", :size=>4 do |d|
|
||||||
d["ID"]
|
d["ID"]
|
||||||
end
|
end
|
||||||
|
@ -54,7 +54,8 @@ class OneTemplateHelper < OpenNebulaHelper::OneHelper
|
|||||||
end
|
end
|
||||||
|
|
||||||
def format_pool(pool, options, top=false)
|
def format_pool(pool, options, top=false)
|
||||||
table=CLIHelper::ShowTable.new(TABLE_CONF_FILE, self) do
|
config_file=self.class.table_conf
|
||||||
|
table=CLIHelper::ShowTable.new(config_file, self) do
|
||||||
column :ID, "ONE identifier for the Template", :size=>4 do |d|
|
column :ID, "ONE identifier for the Template", :size=>4 do |d|
|
||||||
d["ID"]
|
d["ID"]
|
||||||
end
|
end
|
||||||
|
@ -62,7 +62,8 @@ class OneUserHelper < OpenNebulaHelper::OneHelper
|
|||||||
end
|
end
|
||||||
|
|
||||||
def format_pool(pool, options, top=false)
|
def format_pool(pool, options, top=false)
|
||||||
table=CLIHelper::ShowTable.new(TABLE_CONF_FILE, self) do
|
config_file=self.class.table_conf
|
||||||
|
table=CLIHelper::ShowTable.new(config_file, self) do
|
||||||
column :ID, "ONE identifier for the User", :size=>4 do |d|
|
column :ID, "ONE identifier for the User", :size=>4 do |d|
|
||||||
d["ID"]
|
d["ID"]
|
||||||
end
|
end
|
||||||
|
@ -68,7 +68,8 @@ class OneVMHelper < OpenNebulaHelper::OneHelper
|
|||||||
end
|
end
|
||||||
|
|
||||||
def format_pool(pool, options, top=false)
|
def format_pool(pool, options, top=false)
|
||||||
table=CLIHelper::ShowTable.new(TABLE_CONF_FILE, self) do
|
config_file=self.class.table_conf
|
||||||
|
table=CLIHelper::ShowTable.new(config_file, self) do
|
||||||
column :ID, "ONE identifier for Virtual Machine", :size=>4 do |d|
|
column :ID, "ONE identifier for Virtual Machine", :size=>4 do |d|
|
||||||
d["ID"]
|
d["ID"]
|
||||||
end
|
end
|
||||||
|
@ -61,7 +61,8 @@ class OneVNetHelper < OpenNebulaHelper::OneHelper
|
|||||||
end
|
end
|
||||||
|
|
||||||
def format_pool(pool, options, top=false)
|
def format_pool(pool, options, top=false)
|
||||||
table=CLIHelper::ShowTable.new(TABLE_CONF_FILE, self) do
|
config_file=self.class.table_conf
|
||||||
|
table=CLIHelper::ShowTable.new(config_file, self) do
|
||||||
column :ID, "ONE identifier for Virtual Network", :size=>4 do |d|
|
column :ID, "ONE identifier for Virtual Network", :size=>4 do |d|
|
||||||
d["ID"]
|
d["ID"]
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user