aboutsummaryrefslogtreecommitdiff
path: root/lib/leap_cli/commands
diff options
context:
space:
mode:
Diffstat (limited to 'lib/leap_cli/commands')
-rw-r--r--lib/leap_cli/commands/list.rb16
-rw-r--r--lib/leap_cli/commands/pre.rb2
2 files changed, 10 insertions, 8 deletions
diff --git a/lib/leap_cli/commands/list.rb b/lib/leap_cli/commands/list.rb
index 166ed2a..0f1c96e 100644
--- a/lib/leap_cli/commands/list.rb
+++ b/lib/leap_cli/commands/list.rb
@@ -1,16 +1,16 @@
module LeapCli
module Commands
- def self.print_config_table(type, config_list)
+ def self.print_config_table(type, object_list)
style = {:border_x => '-', :border_y => ':', :border_i => '-', :width => 60}
if type == :services
t = table do
self.style = style
self.headings = ['SERVICE', 'NODES']
- list = config_list.keys.sort
+ list = object_list.keys.sort
list.each do |name|
- add_row [name, config_list[name].nodes.keys.join(', ')]
+ add_row [name, object_list[name].node_list.keys.join(', ')]
add_separator unless name == list.last
end
end
@@ -20,9 +20,9 @@ module LeapCli
t = table do
self.style = style
self.headings = ['TAG', 'NODES']
- list = config_list.keys.sort
+ list = object_list.keys.sort
list.each do |name|
- add_row [name, config_list[name].nodes.keys.join(', ')]
+ add_row [name, object_list[name].node_list.keys.join(', ')]
add_separator unless name == list.last
end
end
@@ -32,9 +32,11 @@ module LeapCli
t = table do
self.style = style
self.headings = ['NODE', 'SERVICES', 'TAGS']
- list = config_list.keys.sort
+ list = object_list.keys.sort
list.each do |name|
- add_row [name, config_list[name].services.to_a.join(', '), config_list[name].tags.to_a.join(', ')]
+ services = object_list[name]['services'] || []
+ tags = object_list[name]['tags'] || []
+ add_row [name, services.to_a.join(', '), tags.to_a.join(', ')]
add_separator unless name == list.last
end
end
diff --git a/lib/leap_cli/commands/pre.rb b/lib/leap_cli/commands/pre.rb
index ae58fc8..2281bf6 100644
--- a/lib/leap_cli/commands/pre.rb
+++ b/lib/leap_cli/commands/pre.rb
@@ -30,7 +30,7 @@ module LeapCli
if Path.ok?
true
else
- exit_now!("Could not find the root directory. Change current working directory or try --root")
+ fail!("Could not find the root directory. Change current working directory or try --root")
end
end