knife-vcloud 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +7 -0
- data/README.md +1 -1
- data/lib/chef/knife/vc_catalog_item_show.rb +24 -57
- data/lib/chef/knife/vc_catalog_show.rb +24 -57
- data/lib/chef/knife/vc_common.rb +103 -0
- data/lib/chef/knife/vc_login.rb +13 -46
- data/lib/chef/knife/vc_org_list.rb +20 -53
- data/lib/chef/knife/vc_org_show.rb +58 -91
- data/lib/chef/knife/vc_vapp_config_network.rb +30 -63
- data/lib/chef/knife/vc_vapp_create.rb +19 -52
- data/lib/chef/knife/vc_vapp_delete.rb +16 -49
- data/lib/chef/knife/vc_vapp_show.rb +38 -71
- data/lib/chef/knife/vc_vapp_start.rb +15 -48
- data/lib/chef/knife/vc_vapp_stop.rb +16 -49
- data/lib/chef/knife/vc_vdc_show.rb +30 -63
- data/lib/chef/knife/vc_vm_config_guest.rb +31 -64
- data/lib/chef/knife/vc_vm_config_network.rb +32 -65
- data/lib/chef/knife/vc_vm_show.rb +29 -62
- metadata +3 -3
- data/lib/chef/knife/common.rb +0 -56
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -16,73 +16,40 @@
|
|
16
16
|
# limitations under the License.
|
17
17
|
#
|
18
18
|
|
19
|
-
require 'chef/knife'
|
19
|
+
require 'chef/knife/vc_common'
|
20
20
|
|
21
|
-
|
22
|
-
class
|
23
|
-
|
21
|
+
class Chef
|
22
|
+
class Knife
|
23
|
+
class VcCatalogItemShow < Chef::Knife
|
24
|
+
include Knife::VcCommon
|
24
25
|
|
25
|
-
|
26
|
-
require 'vcloud-rest/connection'
|
27
|
-
require 'chef/api_client'
|
28
|
-
end
|
29
|
-
|
30
|
-
banner "knife vc catalog item show [CATALOG_ID] (options)"
|
31
|
-
|
32
|
-
option :vcloud_url,
|
33
|
-
:short => "-H URL",
|
34
|
-
:long => "--vcloud-url URL",
|
35
|
-
:description => "The vCloud endpoint URL",
|
36
|
-
:proc => Proc.new { |url| Chef::Config[:knife][:vcloud_url] = url }
|
37
|
-
|
38
|
-
option :vcloud_user,
|
39
|
-
:short => "-U USER",
|
40
|
-
:long => "--vcloud-user USER",
|
41
|
-
:description => "Your vCloud User",
|
42
|
-
:proc => Proc.new { |key| Chef::Config[:knife][:vcloud_user] = key }
|
26
|
+
banner "knife vc catalog item show [CATALOG_ID] (options)"
|
43
27
|
|
44
|
-
|
45
|
-
|
46
|
-
:long => "--vcloud-password SECRET",
|
47
|
-
:description => "Your vCloud secret key",
|
48
|
-
:proc => Proc.new { |key| Chef::Config[:knife][:vcloud_password] = key }
|
28
|
+
def run
|
29
|
+
$stdout.sync = true
|
49
30
|
|
50
|
-
|
51
|
-
:short => "-O ORGANIZATION",
|
52
|
-
:long => "--vcloud-organization ORGANIZATION",
|
53
|
-
:description => "Your vCloud Organization",
|
54
|
-
:proc => Proc.new { |key| Chef::Config[:knife][:vcloud_org] = key }
|
31
|
+
item_id = @name_args.first
|
55
32
|
|
56
|
-
|
57
|
-
:short => "-A API_VERSION",
|
58
|
-
:long => "--vcloud-api-version API_VERSION",
|
59
|
-
:description => "vCloud API version (1.5 and 5.1 supported)",
|
60
|
-
:proc => Proc.new { |key| Chef::Config[:knife][:vcloud_api_version] = key }
|
33
|
+
connection.login
|
61
34
|
|
62
|
-
|
63
|
-
|
35
|
+
header = [
|
36
|
+
ui.color('Name', :bold),
|
37
|
+
ui.color('Template ID', :bold)
|
38
|
+
]
|
64
39
|
|
65
|
-
|
40
|
+
description, items = connection.show_catalog_item item_id
|
41
|
+
connection.logout
|
66
42
|
|
67
|
-
|
43
|
+
puts "#{ui.color('Description:', :cyan)} #{description}"
|
44
|
+
list = header
|
45
|
+
list.flatten!
|
46
|
+
items.each do |k, v|
|
47
|
+
list << (k || '')
|
48
|
+
list << (v || '')
|
49
|
+
end
|
68
50
|
|
69
|
-
|
70
|
-
ui.color('Name', :bold),
|
71
|
-
ui.color('Template ID', :bold)
|
72
|
-
]
|
73
|
-
|
74
|
-
description, items = connection.show_catalog_item item_id
|
75
|
-
connection.logout
|
76
|
-
|
77
|
-
puts "#{ui.color('Description:', :cyan)} #{description}"
|
78
|
-
list = header
|
79
|
-
list.flatten!
|
80
|
-
items.each do |k, v|
|
81
|
-
list << (k || '')
|
82
|
-
list << (v || '')
|
51
|
+
puts ui.list(list, :columns_across, 2)
|
83
52
|
end
|
84
|
-
|
85
|
-
puts ui.list(list, :columns_across, 2)
|
86
53
|
end
|
87
54
|
end
|
88
55
|
end
|
@@ -16,73 +16,40 @@
|
|
16
16
|
# limitations under the License.
|
17
17
|
#
|
18
18
|
|
19
|
-
require 'chef/knife'
|
19
|
+
require 'chef/knife/vc_common'
|
20
20
|
|
21
|
-
|
22
|
-
class
|
23
|
-
|
21
|
+
class Chef
|
22
|
+
class Knife
|
23
|
+
class VcCatalogShow < Chef::Knife
|
24
|
+
include Knife::VcCommon
|
24
25
|
|
25
|
-
|
26
|
-
require 'vcloud-rest/connection'
|
27
|
-
require 'chef/api_client'
|
28
|
-
end
|
29
|
-
|
30
|
-
banner "knife vc catalog show [CATALOG_ID] (options)"
|
31
|
-
|
32
|
-
option :vcloud_url,
|
33
|
-
:short => "-H URL",
|
34
|
-
:long => "--vcloud-url URL",
|
35
|
-
:description => "The vCloud endpoint URL",
|
36
|
-
:proc => Proc.new { |url| Chef::Config[:knife][:vcloud_url] = url }
|
37
|
-
|
38
|
-
option :vcloud_user,
|
39
|
-
:short => "-U USER",
|
40
|
-
:long => "--vcloud-user USER",
|
41
|
-
:description => "Your vCloud User",
|
42
|
-
:proc => Proc.new { |key| Chef::Config[:knife][:vcloud_user] = key }
|
26
|
+
banner "knife vc catalog show [CATALOG_ID] (options)"
|
43
27
|
|
44
|
-
|
45
|
-
|
46
|
-
:long => "--vcloud-password SECRET",
|
47
|
-
:description => "Your vCloud secret key",
|
48
|
-
:proc => Proc.new { |key| Chef::Config[:knife][:vcloud_password] = key }
|
28
|
+
def run
|
29
|
+
$stdout.sync = true
|
49
30
|
|
50
|
-
|
51
|
-
:short => "-O ORGANIZATION",
|
52
|
-
:long => "--vcloud-organization ORGANIZATION",
|
53
|
-
:description => "Your vCloud Organization",
|
54
|
-
:proc => Proc.new { |key| Chef::Config[:knife][:vcloud_org] = key }
|
31
|
+
catalog_id = @name_args.first
|
55
32
|
|
56
|
-
|
57
|
-
:short => "-A API_VERSION",
|
58
|
-
:long => "--vcloud-api-version API_VERSION",
|
59
|
-
:description => "vCloud API version (1.5 and 5.1 supported)",
|
60
|
-
:proc => Proc.new { |key| Chef::Config[:knife][:vcloud_api_version] = key }
|
33
|
+
connection.login
|
61
34
|
|
62
|
-
|
63
|
-
|
35
|
+
header = [
|
36
|
+
ui.color('Name', :bold),
|
37
|
+
ui.color('ID', :bold)
|
38
|
+
]
|
64
39
|
|
65
|
-
|
40
|
+
description, items = connection.show_catalog catalog_id
|
41
|
+
connection.logout
|
66
42
|
|
67
|
-
|
43
|
+
puts "#{ui.color('Description:', :cyan)} #{description}"
|
44
|
+
list = header
|
45
|
+
list.flatten!
|
46
|
+
items.each do |k, v|
|
47
|
+
list << (k || '')
|
48
|
+
list << (v || '')
|
49
|
+
end
|
68
50
|
|
69
|
-
|
70
|
-
ui.color('Name', :bold),
|
71
|
-
ui.color('ID', :bold)
|
72
|
-
]
|
73
|
-
|
74
|
-
description, items = connection.show_catalog catalog_id
|
75
|
-
connection.logout
|
76
|
-
|
77
|
-
puts "#{ui.color('Description:', :cyan)} #{description}"
|
78
|
-
list = header
|
79
|
-
list.flatten!
|
80
|
-
items.each do |k, v|
|
81
|
-
list << (k || '')
|
82
|
-
list << (v || '')
|
51
|
+
puts ui.list(list, :columns_across, 2)
|
83
52
|
end
|
84
|
-
|
85
|
-
puts ui.list(list, :columns_across, 2)
|
86
53
|
end
|
87
54
|
end
|
88
55
|
end
|
@@ -0,0 +1,103 @@
|
|
1
|
+
#
|
2
|
+
# Author:: Stefano Tortarolo (<stefano.tortarolo@gmail.com>)
|
3
|
+
# Copyright:: Copyright (c) 2012
|
4
|
+
# License:: Apache License, Version 2.0
|
5
|
+
#
|
6
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
7
|
+
# you may not use this file except in compliance with the License.
|
8
|
+
# You may obtain a copy of the License at
|
9
|
+
#
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
#
|
12
|
+
# Unless required by applicable law or agreed to in writing, software
|
13
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
+
# See the License for the specific language governing permissions and
|
16
|
+
# limitations under the License.
|
17
|
+
#
|
18
|
+
|
19
|
+
require 'chef/knife'
|
20
|
+
|
21
|
+
class Chef
|
22
|
+
class Knife
|
23
|
+
# Module for operations common among commands
|
24
|
+
module VcCommon
|
25
|
+
# :nodoc:
|
26
|
+
# Would prefer to do this in a rational way, but can't be done b/c of
|
27
|
+
# Mixlib::CLI's design :(
|
28
|
+
def self.included(includer)
|
29
|
+
includer.class_eval do
|
30
|
+
|
31
|
+
deps do
|
32
|
+
require 'vcloud-rest/connection'
|
33
|
+
require 'chef/api_client'
|
34
|
+
end
|
35
|
+
|
36
|
+
option :vcloud_url,
|
37
|
+
:short => "-H URL",
|
38
|
+
:long => "--vcloud-url URL",
|
39
|
+
:description => "The vCloud endpoint URL",
|
40
|
+
:proc => Proc.new { |url| Chef::Config[:knife][:vcloud_url] = url }
|
41
|
+
|
42
|
+
option :vcloud_user,
|
43
|
+
:short => "-U USER",
|
44
|
+
:long => "--vcloud-user USER",
|
45
|
+
:description => "Your vCloud User",
|
46
|
+
:proc => Proc.new { |key| Chef::Config[:knife][:vcloud_user] = key }
|
47
|
+
|
48
|
+
option :vcloud_password,
|
49
|
+
:short => "-P SECRET",
|
50
|
+
:long => "--vcloud-password SECRET",
|
51
|
+
:description => "Your vCloud secret key",
|
52
|
+
:proc => Proc.new { |key| Chef::Config[:knife][:vcloud_password] = key }
|
53
|
+
|
54
|
+
option :vcloud_org,
|
55
|
+
:short => "-O ORGANIZATION",
|
56
|
+
:long => "--vcloud-organization ORGANIZATION",
|
57
|
+
:description => "Your vCloud Organization",
|
58
|
+
:proc => Proc.new { |key| Chef::Config[:knife][:vcloud_org] = key }
|
59
|
+
|
60
|
+
option :vcloud_api_version,
|
61
|
+
:short => "-A API_VERSION",
|
62
|
+
:long => "--vcloud-api-version API_VERSION",
|
63
|
+
:description => "vCloud API version (1.5 and 5.1 supported)",
|
64
|
+
:proc => Proc.new { |key| Chef::Config[:knife][:vcloud_api_version] = key }
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
def connection
|
69
|
+
unless @connection
|
70
|
+
@connection = VCloudClient::Connection.new(
|
71
|
+
locate_config_value(:vcloud_url),
|
72
|
+
locate_config_value(:vcloud_user),
|
73
|
+
locate_config_value(:vcloud_password),
|
74
|
+
locate_config_value(:vcloud_org),
|
75
|
+
locate_config_value(:vcloud_api_version)
|
76
|
+
)
|
77
|
+
end
|
78
|
+
@connection
|
79
|
+
end
|
80
|
+
|
81
|
+
def out_msg(label, value)
|
82
|
+
if value && !value.empty?
|
83
|
+
puts "#{ui.color(label, :cyan)}: #{value}"
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
def locate_config_value(key)
|
88
|
+
key = key.to_sym
|
89
|
+
Chef::Config[:knife][key] || config[key]
|
90
|
+
end
|
91
|
+
|
92
|
+
def wait_task(connection, task_id)
|
93
|
+
status, errormsg, start_time, end_time = connection.wait_task_completion task_id
|
94
|
+
puts "Done!"
|
95
|
+
out_msg("Summary", "Status: #{ui.color(status, :cyan)} - started at #{start_time} and ended at #{end_time}")
|
96
|
+
|
97
|
+
if errormsg
|
98
|
+
puts ui.color("ATTENTION: #{errormsg}", :red)
|
99
|
+
end
|
100
|
+
end
|
101
|
+
end
|
102
|
+
end
|
103
|
+
end
|
data/lib/chef/knife/vc_login.rb
CHANGED
@@ -16,56 +16,23 @@
|
|
16
16
|
# limitations under the License.
|
17
17
|
#
|
18
18
|
|
19
|
-
require 'chef/knife'
|
19
|
+
require 'chef/knife/vc_common'
|
20
20
|
|
21
|
-
|
22
|
-
class
|
23
|
-
|
21
|
+
class Chef
|
22
|
+
class Knife
|
23
|
+
class VcLogin < Chef::Knife
|
24
|
+
include Knife::VcCommon
|
24
25
|
|
25
|
-
|
26
|
-
require 'vcloud-rest/connection'
|
27
|
-
require 'chef/api_client'
|
28
|
-
end
|
29
|
-
|
30
|
-
banner "knife vc login (options)"
|
31
|
-
|
32
|
-
option :vcloud_url,
|
33
|
-
:short => "-H URL",
|
34
|
-
:long => "--vcloud-url URL",
|
35
|
-
:description => "The vCloud endpoint URL",
|
36
|
-
:proc => Proc.new { |url| Chef::Config[:knife][:vcloud_url] = url }
|
37
|
-
|
38
|
-
option :vcloud_user,
|
39
|
-
:short => "-U USER",
|
40
|
-
:long => "--vcloud-user USER",
|
41
|
-
:description => "Your vCloud User",
|
42
|
-
:proc => Proc.new { |key| Chef::Config[:knife][:vcloud_user] = key }
|
43
|
-
|
44
|
-
option :vcloud_password,
|
45
|
-
:short => "-P SECRET",
|
46
|
-
:long => "--vcloud-password SECRET",
|
47
|
-
:description => "Your vCloud secret key",
|
48
|
-
:proc => Proc.new { |key| Chef::Config[:knife][:vcloud_password] = key }
|
49
|
-
|
50
|
-
option :vcloud_org,
|
51
|
-
:short => "-O ORGANIZATION",
|
52
|
-
:long => "--vcloud-organization ORGANIZATION",
|
53
|
-
:description => "Your vCloud Organization",
|
54
|
-
:proc => Proc.new { |key| Chef::Config[:knife][:vcloud_org] = key }
|
55
|
-
|
56
|
-
option :vcloud_api_version,
|
57
|
-
:short => "-A API_VERSION",
|
58
|
-
:long => "--vcloud-api-version API_VERSION",
|
59
|
-
:description => "vCloud API version (1.5 and 5.1 supported)",
|
60
|
-
:proc => Proc.new { |key| Chef::Config[:knife][:vcloud_api_version] = key }
|
26
|
+
banner "knife vc login (options)"
|
61
27
|
|
62
|
-
|
63
|
-
|
28
|
+
def run
|
29
|
+
$stdout.sync = true
|
64
30
|
|
65
|
-
|
66
|
-
|
31
|
+
connection.login
|
32
|
+
out_msg("Authenticated successfully, code", connection.auth_key)
|
67
33
|
|
68
|
-
|
34
|
+
connection.logout
|
35
|
+
end
|
69
36
|
end
|
70
37
|
end
|
71
|
-
end
|
38
|
+
end
|
@@ -16,66 +16,33 @@
|
|
16
16
|
# limitations under the License.
|
17
17
|
#
|
18
18
|
|
19
|
-
require 'chef/knife'
|
19
|
+
require 'chef/knife/vc_common'
|
20
20
|
|
21
|
-
|
22
|
-
class
|
23
|
-
|
21
|
+
class Chef
|
22
|
+
class Knife
|
23
|
+
class VcOrgList < Chef::Knife
|
24
|
+
include Knife::VcCommon
|
24
25
|
|
25
|
-
|
26
|
-
require 'vcloud-rest/connection'
|
27
|
-
require 'chef/api_client'
|
28
|
-
end
|
29
|
-
|
30
|
-
banner "knife vc org list (options)"
|
31
|
-
|
32
|
-
option :vcloud_url,
|
33
|
-
:short => "-H URL",
|
34
|
-
:long => "--vcloud-url URL",
|
35
|
-
:description => "The vCloud endpoint URL",
|
36
|
-
:proc => Proc.new { |url| Chef::Config[:knife][:vcloud_url] = url }
|
37
|
-
|
38
|
-
option :vcloud_user,
|
39
|
-
:short => "-U USER",
|
40
|
-
:long => "--vcloud-user USER",
|
41
|
-
:description => "Your vCloud User",
|
42
|
-
:proc => Proc.new { |key| Chef::Config[:knife][:vcloud_user] = key }
|
43
|
-
|
44
|
-
option :vcloud_password,
|
45
|
-
:short => "-P SECRET",
|
46
|
-
:long => "--vcloud-password SECRET",
|
47
|
-
:description => "Your vCloud secret key",
|
48
|
-
:proc => Proc.new { |key| Chef::Config[:knife][:vcloud_password] = key }
|
49
|
-
|
50
|
-
option :vcloud_org,
|
51
|
-
:short => "-O ORGANIZATION",
|
52
|
-
:long => "--vcloud-organization ORGANIZATION",
|
53
|
-
:description => "Your vCloud Organization",
|
54
|
-
:proc => Proc.new { |key| Chef::Config[:knife][:vcloud_org] = key }
|
55
|
-
|
56
|
-
option :vcloud_api_version,
|
57
|
-
:short => "-A API_VERSION",
|
58
|
-
:long => "--vcloud-api-version API_VERSION",
|
59
|
-
:description => "vCloud API version (1.5 and 5.1 supported)",
|
60
|
-
:proc => Proc.new { |key| Chef::Config[:knife][:vcloud_api_version] = key }
|
26
|
+
banner "knife vc org list (options)"
|
61
27
|
|
62
|
-
|
63
|
-
|
28
|
+
def run
|
29
|
+
$stdout.sync = true
|
64
30
|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
31
|
+
list = [
|
32
|
+
ui.color('Name', :bold),
|
33
|
+
ui.color('ID', :bold)
|
34
|
+
]
|
69
35
|
|
70
|
-
|
71
|
-
|
72
|
-
|
36
|
+
connection.login
|
37
|
+
org_list = connection.list_organizations
|
38
|
+
connection.logout
|
73
39
|
|
74
|
-
|
75
|
-
|
76
|
-
|
40
|
+
org_list.each do |k, v|
|
41
|
+
list << (k || '')
|
42
|
+
list << (v || '')
|
43
|
+
end
|
44
|
+
puts ui.list(list, :columns_across, 2)
|
77
45
|
end
|
78
|
-
puts ui.list(list, :columns_across, 2)
|
79
46
|
end
|
80
47
|
end
|
81
48
|
end
|
@@ -16,97 +16,64 @@
|
|
16
16
|
# limitations under the License.
|
17
17
|
#
|
18
18
|
|
19
|
-
require 'chef/knife'
|
20
|
-
|
21
|
-
|
22
|
-
class
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
list = ["#{ui.color('CATALOGS', :cyan)}", '']
|
78
|
-
list << header
|
79
|
-
list.flatten!
|
80
|
-
catalogs.each do |k, v|
|
81
|
-
list << (k || '')
|
82
|
-
list << (v || '')
|
83
|
-
end
|
84
|
-
|
85
|
-
list << ['', '', "#{ui.color('VDCs', :cyan)}", '']
|
86
|
-
list << header
|
87
|
-
list.flatten!
|
88
|
-
vdcs.each do |k, v|
|
89
|
-
list << (k || '')
|
90
|
-
list << (v || '')
|
19
|
+
require 'chef/knife/vc_common'
|
20
|
+
|
21
|
+
class Chef
|
22
|
+
class Knife
|
23
|
+
class VcOrgShow < Chef::Knife
|
24
|
+
include Knife::VcCommon
|
25
|
+
|
26
|
+
banner "knife vc org show [ORG_ID] (options)"
|
27
|
+
|
28
|
+
def run
|
29
|
+
$stdout.sync = true
|
30
|
+
|
31
|
+
org_id = @name_args.first
|
32
|
+
|
33
|
+
connection.login
|
34
|
+
|
35
|
+
header = [
|
36
|
+
ui.color('Name', :bold),
|
37
|
+
ui.color('ID', :bold)
|
38
|
+
]
|
39
|
+
|
40
|
+
catalogs, vdcs, networks, tasklists = connection.show_organization org_id
|
41
|
+
connection.logout
|
42
|
+
|
43
|
+
list = ["#{ui.color('CATALOGS', :cyan)}", '']
|
44
|
+
list << header
|
45
|
+
list.flatten!
|
46
|
+
catalogs.each do |k, v|
|
47
|
+
list << (k || '')
|
48
|
+
list << (v || '')
|
49
|
+
end
|
50
|
+
|
51
|
+
list << ['', '', "#{ui.color('VDCs', :cyan)}", '']
|
52
|
+
list << header
|
53
|
+
list.flatten!
|
54
|
+
vdcs.each do |k, v|
|
55
|
+
list << (k || '')
|
56
|
+
list << (v || '')
|
57
|
+
end
|
58
|
+
|
59
|
+
list << ['', '', "#{ui.color('NETWORKS', :cyan)}", '']
|
60
|
+
list << header
|
61
|
+
list.flatten!
|
62
|
+
networks.each do |k, v|
|
63
|
+
list << (k || '')
|
64
|
+
list << (v || '')
|
65
|
+
end
|
66
|
+
|
67
|
+
list << ['', '', "#{ui.color('TASKLISTS', :cyan)}", '']
|
68
|
+
list << header
|
69
|
+
list.flatten!
|
70
|
+
tasklists.each do |k, v|
|
71
|
+
list << (k || '<unnamed list>')
|
72
|
+
list << (v || '')
|
73
|
+
end
|
74
|
+
|
75
|
+
puts ui.list(list, :columns_across, 2)
|
91
76
|
end
|
92
|
-
|
93
|
-
list << ['', '', "#{ui.color('NETWORKS', :cyan)}", '']
|
94
|
-
list << header
|
95
|
-
list.flatten!
|
96
|
-
networks.each do |k, v|
|
97
|
-
list << (k || '')
|
98
|
-
list << (v || '')
|
99
|
-
end
|
100
|
-
|
101
|
-
list << ['', '', "#{ui.color('TASKLISTS', :cyan)}", '']
|
102
|
-
list << header
|
103
|
-
list.flatten!
|
104
|
-
tasklists.each do |k, v|
|
105
|
-
list << (k || '<unnamed list>')
|
106
|
-
list << (v || '')
|
107
|
-
end
|
108
|
-
|
109
|
-
puts ui.list(list, :columns_across, 2)
|
110
77
|
end
|
111
78
|
end
|
112
|
-
end
|
79
|
+
end
|