opennebula-cli 6.6.1 → 6.6.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 37f8dd6d06bf545de5c8bcf9d9e8197856b452034d22554ed16e3229ecefbec2
4
- data.tar.gz: 2ad8583c107fc4ee73cab873c87f1a8ff6e8973f6bf1b230fda8ac09890f0f1b
3
+ metadata.gz: 21c8a6e2683191cfb58031afd725ea75ddad8d6034c2002c93e5a5d9f86c61c2
4
+ data.tar.gz: 8aa8cfbbac6a3f522c7e04646c63681580608b417ab87b1804dd9b28284c0eca
5
5
  SHA512:
6
- metadata.gz: e1faa197784299af5b92897d19ea3defef548567c0106bec432cd37e7cd8487be6c1d00efcc886283a3387ffc9d77ad528f62e09ea63ba99a8cc2a9b14f30f6f
7
- data.tar.gz: 6c34366bfa1e4917ad1f930915bc229b1fae6af303ad7a1c050977dadac9b991cc0b2f8016ec67c23fd7122e7bf8cd471aa17a00b1e205332a81bc2b39d343a7
6
+ metadata.gz: 784f2bc0129a173ce3ce6e9699544fc835e4999524907a751d160713306744aee8bb3c73987f6af0665a34882fbb8f9ac5792f08f79e505ef7770ab371df5d63
7
+ data.tar.gz: ac3df996ca1205fc96fc1e0fc23fa66e91f78d75b2cf2d58fc2d7750ff51742c605b896dcc16c07b8e8bb9f0fa04208d0bfe24cb5072fab360930aa26ad69e6f
data/bin/oneflow-template CHANGED
@@ -61,6 +61,7 @@ require 'command_parser'
61
61
  require 'opennebula/oneflow_client'
62
62
  require 'cli_helper'
63
63
  require 'one_helper/oneflowtemplate_helper'
64
+ require 'one_helper/onetemplate_helper'
64
65
 
65
66
  USER_AGENT = 'CLI'
66
67
 
@@ -78,7 +79,7 @@ CommandParser::CmdParser.new(ARGV) do
78
79
 
79
80
  RECURSIVE = {
80
81
  :name => 'recursive',
81
- :short => '-r',
82
+ :short => '-R',
82
83
  :large => '--recursive',
83
84
  :description => 'Clone the template recursively (templates and images)'
84
85
  }
@@ -253,14 +254,18 @@ CommandParser::CmdParser.new(ARGV) do
253
254
  break
254
255
  end
255
256
 
257
+ params['merge_template'] = {}
256
258
  body = JSON.parse(response.body)['DOCUMENT']['TEMPLATE']['BODY']
257
259
 
258
- params['merge_template'] = helper.custom_attrs(
259
- body['custom_attrs']
260
- )
260
+ # Check global custom attributes
261
+ custom_attrs = helper.custom_attrs(body['custom_attrs'])
262
+ params['merge_template'].merge!(custom_attrs) unless custom_attrs.nil?
261
263
 
262
- params['merge_template'] = {} unless params['merge_template']
264
+ # Check role level custom attributes
265
+ custom_role_attrs = helper.custom_role_attrs(body['roles'])
266
+ params['merge_template'].merge!(custom_role_attrs) unless custom_role_attrs.nil?
263
267
 
268
+ # Check vnets attributes
264
269
  vnets = helper.networks(body['networks'])
265
270
  params['merge_template'].merge!(vnets) unless vnets.nil?
266
271
  end
data/bin/onevm CHANGED
@@ -1594,6 +1594,25 @@ CommandParser::CmdParser.new(ARGV) do
1594
1594
  end
1595
1595
  end
1596
1596
 
1597
+ backup_cancel_desc = <<-EOT.unindent
1598
+ Cancels an active VM backup operation
1599
+
1600
+ States: RUNNING, POWEROFF
1601
+ EOT
1602
+
1603
+ command :'backup-cancel',
1604
+ backup_cancel_desc,
1605
+ :vmid do
1606
+ helper.perform_action(args[0], options, 'Canceling backup') do |vm|
1607
+ rc = vm.backup_cancel
1608
+
1609
+ if OpenNebula.is_error?(rc)
1610
+ STDERR.puts "Error canceling VM backup: #{rc.message}"
1611
+ exit(-1)
1612
+ end
1613
+ end
1614
+ end
1615
+
1597
1616
  ssh_desc = <<-EOT.unindent
1598
1617
  SSH into VM
1599
1618
 
@@ -193,6 +193,35 @@ class OneFlowTemplateHelper < OpenNebulaHelper::OneHelper
193
193
  ret
194
194
  end
195
195
 
196
+ # Get custom role attributes values from user
197
+ #
198
+ # @param role [Hash] Service role with custom attributes
199
+ #
200
+ # @return [Hash] Role with custom attributes values
201
+ def custom_role_attrs(roles)
202
+ return if roles.nil? || roles.empty?
203
+
204
+ ret = {}
205
+ role_with_custom_attrs = false
206
+
207
+ roles.each do |role|
208
+ next unless role.key?('custom_attrs')
209
+
210
+ ####################################################################
211
+ # Display Role Information
212
+ ####################################################################
213
+ header = "> Please insert the user inputs for the role \"#{role['name']}\""
214
+ puts header
215
+
216
+ role.merge!(custom_attrs(role['custom_attrs']))
217
+ role_with_custom_attrs = true
218
+ end
219
+
220
+ ret['roles'] = roles if role_with_custom_attrs
221
+
222
+ ret
223
+ end
224
+
196
225
  def networks(vnets)
197
226
  return unless vnets
198
227
 
@@ -53,6 +53,7 @@ EOT
53
53
 
54
54
  RECURSIVE={
55
55
  :name => "recursive",
56
+ :short => "-R",
56
57
  :large => "--recursive",
57
58
  :description => "Applies the action to the template plus any "+
58
59
  "image defined in DISK"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opennebula-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.6.1
4
+ version: 6.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - OpenNebula
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-03-07 00:00:00.000000000 Z
11
+ date: 2023-05-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: opennebula
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 6.6.1
19
+ version: 6.6.2
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 6.6.1
26
+ version: 6.6.2
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: activesupport
29
29
  requirement: !ruby/object:Gem::Requirement