opennebula-cli 7.1.80.pre → 7.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. checksums.yaml +4 -4
  2. data/bin/oneacct +1 -1
  3. data/bin/oneacl +1 -1
  4. data/bin/onebackupjob +1 -1
  5. data/bin/onecluster +1 -1
  6. data/bin/onedatastore +1 -1
  7. data/bin/oneflow +1 -1
  8. data/bin/oneflow-template +1 -1
  9. data/bin/oneform +1 -1
  10. data/bin/onegroup +1 -1
  11. data/bin/onehook +1 -1
  12. data/bin/onehost +1 -1
  13. data/bin/oneimage +1 -1
  14. data/bin/oneirb +1 -1
  15. data/bin/onelog +1 -1
  16. data/bin/onemarket +1 -1
  17. data/bin/onemarketapp +1 -1
  18. data/bin/onesecgroup +1 -1
  19. data/bin/oneshowback +1 -1
  20. data/bin/onetemplate +1 -1
  21. data/bin/oneuser +1 -1
  22. data/bin/onevdc +1 -1
  23. data/bin/onevm +2 -2
  24. data/bin/onevmgroup +1 -1
  25. data/bin/onevnet +1 -1
  26. data/bin/onevntemplate +1 -1
  27. data/bin/onevrouter +1 -1
  28. data/bin/onezone +1 -1
  29. data/lib/cli_helper.rb +1 -1
  30. data/lib/command_parser.rb +135 -126
  31. data/lib/load_opennebula_paths.rb +5 -0
  32. data/lib/ods_helper.rb +541 -0
  33. data/lib/one_helper/oneacct_helper.rb +117 -109
  34. data/lib/one_helper/oneacl_helper.rb +1 -1
  35. data/lib/one_helper/onebackupjob_helper.rb +1 -1
  36. data/lib/one_helper/onecluster_helper.rb +1 -1
  37. data/lib/one_helper/onedatastore_helper.rb +87 -80
  38. data/lib/one_helper/oneflow_helper.rb +1 -1
  39. data/lib/one_helper/oneflowtemplate_helper.rb +1 -1
  40. data/lib/one_helper/oneform_helper.rb +1 -1
  41. data/lib/one_helper/onegroup_helper.rb +1 -1
  42. data/lib/one_helper/onehook_helper.rb +1 -1
  43. data/lib/one_helper/onehost_helper.rb +1 -1
  44. data/lib/one_helper/oneimage_helper.rb +1 -1
  45. data/lib/one_helper/onemarket_helper.rb +59 -58
  46. data/lib/one_helper/onemarketapp_helper.rb +1 -1
  47. data/lib/one_helper/onequota_helper.rb +240 -190
  48. data/lib/one_helper/onesecgroup_helper.rb +87 -85
  49. data/lib/one_helper/onetemplate_helper.rb +64 -64
  50. data/lib/one_helper/oneuser_helper.rb +2 -2
  51. data/lib/one_helper/onevdc_helper.rb +45 -45
  52. data/lib/one_helper/onevm_helper.rb +6 -8
  53. data/lib/one_helper/onevmgroup_helper.rb +65 -63
  54. data/lib/one_helper/onevnet_helper.rb +1 -1
  55. data/lib/one_helper/onevntemplate_helper.rb +43 -40
  56. data/lib/one_helper/onevrouter_helper.rb +86 -87
  57. data/lib/one_helper/onezone_helper.rb +98 -101
  58. data/lib/one_helper.rb +90 -71
  59. data/share/schemas/xsd/acct.xsd +3 -104
  60. data/share/schemas/xsd/cluster.xsd +4 -21
  61. data/share/schemas/xsd/datastore.xsd +4 -29
  62. data/share/schemas/xsd/document.xsd +3 -25
  63. data/share/schemas/xsd/group.xsd +2 -14
  64. data/share/schemas/xsd/group_pool.xsd +2 -14
  65. data/share/schemas/xsd/hook.xsd +2 -0
  66. data/share/schemas/xsd/host.xsd +5 -7
  67. data/share/schemas/xsd/image.xsd +2 -25
  68. data/share/schemas/xsd/marketplace.xsd +3 -22
  69. data/share/schemas/xsd/marketplaceapp.xsd +3 -25
  70. data/share/schemas/xsd/opennebula_configuration.xsd +3 -2
  71. data/share/schemas/xsd/requirements.xsd +3 -21
  72. data/share/schemas/xsd/security_group.xsd +6 -43
  73. data/share/schemas/xsd/shared.xsd +3 -3
  74. data/share/schemas/xsd/vdc.xsd +2 -7
  75. data/share/schemas/xsd/vm_group.xsd +3 -25
  76. data/share/schemas/xsd/vm_pool.xsd +2 -0
  77. data/share/schemas/xsd/vmtemplate.xsd +3 -25
  78. data/share/schemas/xsd/vnet.xsd +9 -67
  79. data/share/schemas/xsd/vnet_pool.xsd +8 -57
  80. data/share/schemas/xsd/vntemplate.xsd +3 -25
  81. data/share/schemas/xsd/vrouter.xsd +4 -32
  82. metadata +8 -6
@@ -1,5 +1,5 @@
1
1
  # -------------------------------------------------------------------------- #
2
- # Copyright 2002-2025, OpenNebula Project, OpenNebula Systems #
2
+ # Copyright 2002-2026, OpenNebula Project, OpenNebula Systems #
3
3
  # #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License"); you may #
5
5
  # not use this file except in compliance with the License. You may obtain #
@@ -18,78 +18,78 @@ require 'one_helper'
18
18
  require 'opennebula/security_group'
19
19
  require 'opennebula/security_group_pool'
20
20
 
21
+ # Helper class for Security Group commands
21
22
  class OneSecurityGroupHelper < OpenNebulaHelper::OneHelper
23
+
22
24
  RECOVER = {
23
- :name => "recover",
24
- :short => "-r",
25
- :large => "--recover" ,
26
- :description => "If set the commit operation will only operate on "\
27
- "outdated and error VMs. This is intended for retrying updates of "\
28
- "VMs or reinitialize the updating process if oned stopped or fail.",
25
+ :name => 'recover',
26
+ :short => '-r',
27
+ :large => '--recover',
28
+ :description => 'If set the commit operation will only operate on '\
29
+ 'outdated and error VMs. This is intended for retrying updates of '\
30
+ 'VMs or reinitialize the updating process if oned stopped or fail.'
29
31
  }
30
32
 
31
33
  def self.rname
32
- "SECURITY_GROUP"
34
+ 'SECURITY_GROUP'
33
35
  end
34
36
 
35
37
  def self.conf_file
36
- "onesecgroup.yaml"
38
+ 'onesecgroup.yaml'
37
39
  end
38
40
 
39
41
  def format_pool(options)
40
42
  config_file = self.class.table_conf
41
43
 
42
- table = CLIHelper::ShowTable.new(config_file, self) do
43
- column :ID, "ONE identifier for the Security Group", :size=>4 do |d|
44
- d["ID"]
44
+ CLIHelper::ShowTable.new(config_file, self) do
45
+ column :ID, 'ONE identifier for the Security Group', :size=>4 do |d|
46
+ d['ID']
45
47
  end
46
48
 
47
- column :NAME, "Name of the Security Group", :left, :size=>20 do |d|
48
- d["NAME"]
49
+ column :NAME, 'Name of the Security Group', :left, :size=>20 do |d|
50
+ d['NAME']
49
51
  end
50
52
 
51
- column :USER, "Username of the Security Group owner", :left,
52
- :size=>15 do |d|
53
+ column :USER, 'Username of the Security Group owner', :left,
54
+ :size=>15 do |d|
53
55
  helper.user_name(d, options)
54
56
  end
55
57
 
56
- column :GROUP, "Group of the Security Group", :left, :size=>15 do |d|
58
+ column :GROUP, 'Group of the Security Group', :left, :size=>15 do |d|
57
59
  helper.group_name(d, options)
58
60
  end
59
61
 
60
- column :UPDATED, "Number of VMs with updated rules", :size=>8 do |d|
61
- if d["UPDATED_VMS"]["ID"].nil?
62
- "0"
62
+ column :UPDATED, 'Number of VMs with updated rules', :size=>8 do |d|
63
+ if d['UPDATED_VMS']['ID'].nil?
64
+ '0'
63
65
  else
64
- [d["UPDATED_VMS"]["ID"]].flatten.size
66
+ [d['UPDATED_VMS']['ID']].flatten.size
65
67
  end
66
68
  end
67
69
 
68
- column :OUTDATED, "Number of VMs with outdated rules", :size=>8 do |d|
69
- if d["OUTDATED_VMS"]["ID"].nil?
70
- "0"
70
+ column :OUTDATED, 'Number of VMs with outdated rules', :size=>8 do |d|
71
+ if d['OUTDATED_VMS']['ID'].nil?
72
+ '0'
71
73
  else
72
- [d["OUTDATED_VMS"]["ID"]].flatten.size
74
+ [d['OUTDATED_VMS']['ID']].flatten.size
73
75
  end
74
76
  end
75
77
 
76
- column :ERROR, "Number of VMs that failed to update rules", :size=>8 do |d|
77
- if d["ERROR_VMS"]["ID"].nil?
78
- "0"
78
+ column :ERROR, 'Number of VMs that failed to update rules', :size=>8 do |d|
79
+ if d['ERROR_VMS']['ID'].nil?
80
+ '0'
79
81
  else
80
- [d["ERROR_VMS"]["ID"]].flatten.size
82
+ [d['ERROR_VMS']['ID']].flatten.size
81
83
  end
82
84
  end
83
85
 
84
86
  default :ID, :USER, :GROUP, :NAME, :UPDATED, :OUTDATED, :ERROR
85
87
  end
86
-
87
- table
88
88
  end
89
89
 
90
90
  private
91
91
 
92
- def factory(id=nil)
92
+ def factory(id = nil)
93
93
  if id
94
94
  OpenNebula::SecurityGroup.new_with_id(id, @client)
95
95
  else
@@ -98,107 +98,109 @@ class OneSecurityGroupHelper < OpenNebulaHelper::OneHelper
98
98
  end
99
99
  end
100
100
 
101
- def factory_pool(user_flag=-2)
101
+ def factory_pool(user_flag = -2)
102
102
  OpenNebula::SecurityGroupPool.new(@client, user_flag)
103
103
  end
104
104
 
105
- def format_resource(secgroup, options = {})
106
- str="%-15s: %-20s"
107
- str_h1="%-80s"
105
+ def format_resource(secgroup, _options = {})
106
+ str='%-15s: %-20s'
107
+ str_h1='%-80s'
108
108
 
109
109
  CLIHelper.print_header(
110
- str_h1 % "SECURITY GROUP #{secgroup['ID']} INFORMATION")
111
- puts str % ["ID", secgroup.id.to_s]
112
- puts str % ["NAME", secgroup.name]
113
- puts str % ["USER", secgroup['UNAME']]
114
- puts str % ["GROUP", secgroup['GNAME']]
115
-
116
- CLIHelper.print_header(str_h1 % "PERMISSIONS",false)
117
-
118
- ["OWNER", "GROUP", "OTHER"].each { |e|
119
- mask = "---"
120
- mask[0] = "u" if secgroup["PERMISSIONS/#{e}_U"] == "1"
121
- mask[1] = "m" if secgroup["PERMISSIONS/#{e}_M"] == "1"
122
- mask[2] = "a" if secgroup["PERMISSIONS/#{e}_A"] == "1"
123
-
124
- puts str % [e, mask]
125
- }
110
+ str_h1 % "SECURITY GROUP #{secgroup['ID']} INFORMATION"
111
+ )
112
+ puts format(str, 'ID', secgroup.id.to_s)
113
+ puts format(str, 'NAME', secgroup.name)
114
+ puts format(str, 'USER', secgroup['UNAME'])
115
+ puts format(str, 'GROUP', secgroup['GNAME'])
116
+
117
+ CLIHelper.print_header(str_h1 % 'PERMISSIONS', false)
118
+
119
+ ['OWNER', 'GROUP', 'OTHER'].each do |e|
120
+ mask = '---'
121
+ mask[0] = 'u' if secgroup["PERMISSIONS/#{e}_U"] == '1'
122
+ mask[1] = 'm' if secgroup["PERMISSIONS/#{e}_M"] == '1'
123
+ mask[2] = 'a' if secgroup["PERMISSIONS/#{e}_A"] == '1'
124
+
125
+ puts format(str, e, mask)
126
+ end
126
127
 
127
128
  puts
128
129
 
129
- CLIHelper.print_header(str_h1 % "VIRTUAL MACHINES", false)
130
+ CLIHelper.print_header(str_h1 % 'VIRTUAL MACHINES', false)
130
131
 
131
132
  updated, outdated, error = secgroup.vm_ids
132
133
 
133
- puts str % ["UPDATED", updated.join(',') ]
134
- puts str % ["OUTDATED", outdated.join(',') ]
135
- puts str % ["ERROR", error.join(',') ]
134
+ puts format(str, 'UPDATED', updated.join(','))
135
+ puts format(str, 'OUTDATED', outdated.join(','))
136
+ puts format(str, 'ERROR', error.join(','))
136
137
 
137
138
  puts
138
139
 
139
- CLIHelper.print_header(str_h1 % ["RULES"], false)
140
+ CLIHelper.print_header(format(str_h1, 'RULES'), false)
140
141
 
141
142
  if !secgroup.to_hash['SECURITY_GROUP']['TEMPLATE']['RULE'].nil?
142
143
  rule_list = [secgroup.to_hash['SECURITY_GROUP']['TEMPLATE']['RULE']].flatten
143
144
  end
144
145
 
145
146
  CLIHelper::ShowTable.new(nil, self) do
146
- column :TYPE, "", :left, :size=>8 do |d|
147
- d["RULE_TYPE"]
147
+ column :TYPE, '', :left, :size=>8 do |d|
148
+ d['RULE_TYPE']
148
149
  end
149
150
 
150
- column :PROTOCOL, "", :left, :size=>8 do |d|
151
- d["PROTOCOL"]
151
+ column :PROTOCOL, '', :left, :size=>8 do |d|
152
+ d['PROTOCOL']
152
153
  end
153
154
 
154
- column :ICMP_TYPE, "", :left, :size=>9 do |d|
155
- d["ICMP_TYPE"]
155
+ column :ICMP_TYPE, '', :left, :size=>9 do |d|
156
+ d['ICMP_TYPE']
156
157
  end
157
158
 
158
- column :ICMVP6_TYPE, "", :left, :size=>11 do |d|
159
- d["ICMPV6_TYPE"]
159
+ column :ICMVP6_TYPE, '', :left, :size=>11 do |d|
160
+ d['ICMPV6_TYPE']
160
161
  end
161
162
 
162
- column :NETWORK, "", :left, :adjust, :size=>35 do |d|
163
- network = ""
164
- if(!d["NETWORK_ID"].nil? && d["NETWORK_ID"] != "")
165
- network += "VNet " + d["NETWORK_ID"]
163
+ column :NETWORK, '', :left, :adjust, :size=>35 do |d|
164
+ network = ''
165
+ if(!d['NETWORK_ID'].nil? && d['NETWORK_ID'] != '')
166
+ network += 'VNet ' + d['NETWORK_ID']
166
167
  end
167
168
 
168
- if(!d["SIZE"].nil? && d["SIZE"] != "")
169
- if(network != "")
170
- network += ": "
169
+ if(!d['SIZE'].nil? && d['SIZE'] != '')
170
+ if(network != '')
171
+ network += ': '
171
172
  end
172
173
 
173
- if(!d["IP"].nil? && d["IP"] != "")
174
- network += "Start: " + d["IP"] + ", "
175
- elsif(!d["MAC"] != undefined && d["MAC"] != "")
176
- network += "Start: " + d["MAC"] + ", "
174
+ if(!d['IP'].nil? && d['IP'] != '')
175
+ network += 'Start: ' + d['IP'] + ', '
176
+ elsif(!d['MAC'] != undefined && d['MAC'] != '')
177
+ network += 'Start: ' + d['MAC'] + ', '
177
178
  end
178
179
 
179
- network += "Size: " + d["SIZE"]
180
+ network += 'Size: ' + d['SIZE']
180
181
  end
181
182
 
182
- if(network == "")
183
- network = "Any"
183
+ if(network == '')
184
+ network = 'Any'
184
185
  end
185
186
 
186
- network += " "
187
+ network += ' '
187
188
  network
188
189
  end
189
190
 
190
- column :RANGE, "", :left, :adjust, :size=>16 do |d|
191
- d["RANGE"]
191
+ column :RANGE, '', :left, :adjust, :size=>16 do |d|
192
+ d['RANGE']
192
193
  end
193
194
  end.show(rule_list, {})
194
195
 
195
- while secgroup.has_elements?("/SECURITY_GROUP/TEMPLATE/RULE")
196
- secgroup.delete_element("/SECURITY_GROUP/TEMPLATE/RULE")
196
+ while secgroup.has_elements?('/SECURITY_GROUP/TEMPLATE/RULE')
197
+ secgroup.delete_element('/SECURITY_GROUP/TEMPLATE/RULE')
197
198
  end
198
199
 
199
200
  puts
200
201
 
201
- CLIHelper.print_header(str_h1 % "TEMPLATE CONTENTS",false)
202
+ CLIHelper.print_header(str_h1 % 'TEMPLATE CONTENTS', false)
202
203
  puts secgroup.template_str
203
204
  end
205
+
204
206
  end
@@ -1,5 +1,5 @@
1
1
  # -------------------------------------------------------------------------- #
2
- # Copyright 2002-2025, OpenNebula Project, OpenNebula Systems #
2
+ # Copyright 2002-2026, OpenNebula Project, OpenNebula Systems #
3
3
  # #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License"); you may #
5
5
  # not use this file except in compliance with the License. You may obtain #
@@ -18,57 +18,58 @@ require 'one_helper'
18
18
  require 'opennebula/template'
19
19
  require 'opennebula/template_pool'
20
20
 
21
+ # Helper class for Template commands
21
22
  class OneTemplateHelper < OpenNebulaHelper::OneHelper
23
+
22
24
  VM_NAME={
23
- :name => "name",
24
- :large => "--name name",
25
+ :name => 'name',
26
+ :large => '--name name',
25
27
  :format => String,
26
- :description => <<-EOT.strip
27
- Name of the new VM or TEMPLATE. When instantiating
28
- multiple VMs you can use the \"%i\" wildcard to produce
29
- different names such as vm-0, vm-1...
30
- EOT
28
+ :description => <<~EOT.strip
29
+ Name of the new VM or TEMPLATE. When instantiating
30
+ multiple VMs you can use the \"%i\" wildcard to produce
31
+ different names such as vm-0, vm-1...
32
+ EOT
31
33
  }
32
34
 
33
35
  MULTIPLE={
34
- :name => "multiple",
35
- :short => "-m x",
36
- :large => "--multiple x",
36
+ :name => 'multiple',
37
+ :short => '-m x',
38
+ :large => '--multiple x',
37
39
  :format => Integer,
38
- :description => "Instance multiple VMs"
40
+ :description => 'Instance multiple VMs'
39
41
  }
40
42
 
41
43
  EXTENDED={
42
- :name => "extended",
43
- :large => "--extended",
44
- :description => "Process the template and included extended "+
45
- "information, such as the SIZE for each DISK"
44
+ :name => 'extended',
45
+ :large => '--extended',
46
+ :description => 'Process the template and included extended '+
47
+ 'information, such as the SIZE for each DISK'
46
48
  }
47
49
 
48
50
  RECURSIVE={
49
- :name => "recursive",
50
- :short => "-R",
51
- :large => "--recursive",
52
- :description => "Applies the action to the template plus any "+
53
- "image defined in DISK"
51
+ :name => 'recursive',
52
+ :short => '-R',
53
+ :large => '--recursive',
54
+ :description => 'Applies the action to the template plus any '+
55
+ 'image defined in DISK'
54
56
  }
55
57
 
56
58
  PERSISTENT={
57
- :name => "persistent",
58
- :large => "--persistent",
59
- :description => "Creates a private persistent copy of the template "+
60
- "plus any image defined in DISK, and instantiates that copy"
59
+ :name => 'persistent',
60
+ :large => '--persistent',
61
+ :description => 'Creates a private persistent copy of the template '+
62
+ 'plus any image defined in DISK, and instantiates that copy'
61
63
  }
62
64
 
63
65
  def self.rname
64
- "VMTEMPLATE"
66
+ 'VMTEMPLATE'
65
67
  end
66
68
 
67
69
  def self.conf_file
68
- "onetemplate.yaml"
70
+ 'onetemplate.yaml'
69
71
  end
70
72
 
71
-
72
73
  def show_resource(id, options)
73
74
  resource = retrieve_resource(id)
74
75
 
@@ -102,33 +103,31 @@ EOT
102
103
  def format_pool(options)
103
104
  config_file = self.class.table_conf
104
105
 
105
- table = CLIHelper::ShowTable.new(config_file, self) do
106
- column :ID, "ONE identifier for the Template", :size=>4 do |d|
107
- d["ID"]
106
+ CLIHelper::ShowTable.new(config_file, self) do
107
+ column :ID, 'ONE identifier for the Template', :size=>4 do |d|
108
+ d['ID']
108
109
  end
109
110
 
110
- column :NAME, "Name of the Template", :left, :size=>27 do |d|
111
- d["NAME"]
111
+ column :NAME, 'Name of the Template', :left, :size=>27 do |d|
112
+ d['NAME']
112
113
  end
113
114
 
114
- column :USER, "Username of the Template owner", :left,
115
- :size=>15 do |d|
115
+ column :USER, 'Username of the Template owner', :left,
116
+ :size=>15 do |d|
116
117
  helper.user_name(d, options)
117
118
  end
118
119
 
119
- column :GROUP, "Group of the Template", :left, :size=>15 do |d|
120
+ column :GROUP, 'Group of the Template', :left, :size=>15 do |d|
120
121
  helper.group_name(d, options)
121
122
  end
122
123
 
123
- column :REGTIME, "Registration time of the Template",
124
- :size=>15 do |d|
125
- OpenNebulaHelper.time_to_str(d["REGTIME"])
124
+ column :REGTIME, 'Registration time of the Template',
125
+ :size=>15 do |d|
126
+ OpenNebulaHelper.time_to_str(d['REGTIME'])
126
127
  end
127
128
 
128
129
  default :ID, :USER, :GROUP, :NAME, :REGTIME
129
130
  end
130
-
131
- table
132
131
  end
133
132
 
134
133
  INT_EXP = /^-?\d+$/
@@ -153,7 +152,7 @@ EOT
153
152
  # template. Useful for cpu, mem, vcpu
154
153
  if key != template['VMTEMPLATE']['TEMPLATE'][key]
155
154
  answers_s << "#{key} = \""
156
- answers_s << val.gsub('"', "\\\"") << "\"\n"
155
+ answers_s << val.gsub('"', '\"') << "\"\n"
157
156
  end
158
157
  end
159
158
 
@@ -162,7 +161,7 @@ EOT
162
161
 
163
162
  private
164
163
 
165
- def factory(id=nil)
164
+ def factory(id = nil)
166
165
  if id
167
166
  OpenNebula::Template.new_with_id(id, @client)
168
167
  else
@@ -171,38 +170,39 @@ EOT
171
170
  end
172
171
  end
173
172
 
174
- def factory_pool(user_flag=-2)
173
+ def factory_pool(user_flag = -2)
175
174
  OpenNebula::TemplatePool.new(@client, user_flag)
176
175
  end
177
176
 
178
- def format_resource(template, options = {})
179
- str="%-15s: %-20s"
180
- str_h1="%-80s"
177
+ def format_resource(template, _options = {})
178
+ str='%-15s: %-20s'
179
+ str_h1='%-80s'
181
180
 
182
181
  CLIHelper.print_header(
183
- str_h1 % "TEMPLATE #{template['ID']} INFORMATION")
184
- puts str % ["ID", template.id.to_s]
185
- puts str % ["NAME", template.name]
186
- puts str % ["USER", template['UNAME']]
187
- puts str % ["GROUP", template['GNAME']]
188
- puts str % ["LOCK", OpenNebulaHelper.level_lock_to_str(template['LOCK/LOCKED'])]
189
- puts str % ["REGISTER TIME",
190
- OpenNebulaHelper.time_to_str(template['REGTIME'])]
182
+ str_h1 % "TEMPLATE #{template['ID']} INFORMATION"
183
+ )
184
+ puts format(str, 'ID', template.id.to_s)
185
+ puts format(str, 'NAME', template.name)
186
+ puts format(str, 'USER', template['UNAME'])
187
+ puts format(str, 'GROUP', template['GNAME'])
188
+ puts format(str, 'LOCK', OpenNebulaHelper.level_lock_to_str(template['LOCK/LOCKED']))
189
+ puts format(str, 'REGISTER TIME', OpenNebulaHelper.time_to_str(template['REGTIME']))
191
190
  puts
192
191
 
193
- CLIHelper.print_header(str_h1 % "PERMISSIONS",false)
192
+ CLIHelper.print_header(str_h1 % 'PERMISSIONS', false)
194
193
 
195
- ["OWNER", "GROUP", "OTHER"].each { |e|
196
- mask = "---"
197
- mask[0] = "u" if template["PERMISSIONS/#{e}_U"] == "1"
198
- mask[1] = "m" if template["PERMISSIONS/#{e}_M"] == "1"
199
- mask[2] = "a" if template["PERMISSIONS/#{e}_A"] == "1"
194
+ ['OWNER', 'GROUP', 'OTHER'].each do |e|
195
+ mask = '---'
196
+ mask[0] = 'u' if template["PERMISSIONS/#{e}_U"] == '1'
197
+ mask[1] = 'm' if template["PERMISSIONS/#{e}_M"] == '1'
198
+ mask[2] = 'a' if template["PERMISSIONS/#{e}_A"] == '1'
200
199
 
201
- puts str % [e, mask]
202
- }
200
+ puts format(str, e, mask)
201
+ end
203
202
  puts
204
203
 
205
- CLIHelper.print_header(str_h1 % "TEMPLATE CONTENTS",false)
204
+ CLIHelper.print_header(str_h1 % 'TEMPLATE CONTENTS', false)
206
205
  puts template.template_str
207
206
  end
207
+
208
208
  end
@@ -1,5 +1,5 @@
1
1
  # -------------------------------------------------------------------------- #
2
- # Copyright 2002-2025, OpenNebula Project, OpenNebula Systems #
2
+ # Copyright 2002-2026, OpenNebula Project, OpenNebula Systems #
3
3
  # #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License"); you may #
5
5
  # not use this file except in compliance with the License. You may obtain #
@@ -410,7 +410,7 @@ class OneUserHelper < OpenNebulaHelper::OneHelper
410
410
 
411
411
  # In case of multiple quotas, use the global quota or the first
412
412
  if q.is_a?(Array)
413
- global_q = q.find {|h| h['CLUSTER_IDS'].nil? || hash['CLUSTER_IDS'].empty? }
413
+ global_q = q.find {|h| h['CLUSTER_IDS'].nil? || h['CLUSTER_IDS'].empty? }
414
414
  q = global_q || q[0]
415
415
  end
416
416