cloudstack-cli 1.2.4 → 1.2.5

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: af33fbc2eb5c099bbb2492f3ffc94dbdb0207790
4
- data.tar.gz: 79ff5405d147afc75c35f2831e5c2bebe698716e
3
+ metadata.gz: 99141439bf28aa5016f37c7f0c177724c60a26c6
4
+ data.tar.gz: 1241704a4a4737469786b5e1f7a7d90deba16c54
5
5
  SHA512:
6
- metadata.gz: fdc510c21f629586df1a7053d680f97506ed852fd2651071160c8574f1fb0b8dd31dd54d0ba78d92ad640d2c993f6e19cd56b93ca790a544e97dbaf2a153940b
7
- data.tar.gz: ec560b06fb8d6570da88d66f611e34a4c483254bd89c18a1b6a1ad85db05fc3e75ba6f997134d484a3f8d475c8b0e2f12e0e44bacbddce9ea0a1167d2b3d00e1
6
+ metadata.gz: 073ac88981b9a4a0e8b355f5a476881d084a41838e04a8261dcf86993e8650874571706419ef68d64e1c7f2959a17e87a772fde3debef4dc172befec62f89190
7
+ data.tar.gz: a9de0b7fa807eafd2164fd1d4c6ca222cde76d8a0cea41ca8ce639a0fd49407e21b5d5ce227cd992b0a920f2173711296d829d2386f160e054e84567d7797718
data/Gemfile.lock CHANGED
@@ -7,7 +7,7 @@ PATH
7
7
  PATH
8
8
  remote: .
9
9
  specs:
10
- cloudstack-cli (1.2.3)
10
+ cloudstack-cli (1.2.5)
11
11
  cloudstack_client (~> 1.2)
12
12
  multi_json (~> 1.11)
13
13
  thor (~> 0.19)
@@ -1,4 +1,5 @@
1
1
  require "thor"
2
+ require "cloudstack-cli/thor_patch"
2
3
  require "yaml"
3
4
  require "open-uri"
4
5
 
@@ -35,6 +36,16 @@ module CloudstackCli
35
36
  true
36
37
  end
37
38
 
39
+ # fix for subcommand help issues
40
+ # see https://github.com/erikhuda/thor/issues/261
41
+ # def self.banner(command, namespace = nil, subcommand = false)
42
+ # "#{basename} #{subcommand_prefix} #{command.usage}"
43
+ # end
44
+ #
45
+ # def self.subcommand_prefix
46
+ # self.name.gsub(%r{.*::}, '').gsub(%r{^[A-Z]}) { |match| match[0].downcase }.gsub(%r{[A-Z]}) { |match| "-#{match[0].downcase}" }
47
+ # end
48
+
38
49
  no_commands do
39
50
  def client
40
51
  @config ||= load_configuration
@@ -133,7 +133,7 @@ class VirtualMachine < CloudstackCli::Base
133
133
  unless virtual_machine = client.list_virtual_machines(options.merge(name: name, listall: true)).first
134
134
  say "Virtual machine #{name} not found.", :red
135
135
  else
136
- ask = "Destroy #{name} (#{virtual machine['state']})? [y/N]:"
136
+ ask = "Destroy #{name} (#{virtual_machine['state']})? [y/N]:"
137
137
  if options[:force] || yes?(ask, :yellow)
138
138
  say "destroying #{name} "
139
139
  client.destroy_virtual_machine(
@@ -108,7 +108,6 @@ module CloudstackCli
108
108
  exit 1
109
109
  end
110
110
  unless options[:disk_offering_id]
111
- puts options
112
111
  say "Error: a disk offering is required when using iso.", :red
113
112
  exit 1
114
113
  end
@@ -0,0 +1,26 @@
1
+ # Fixes thor help for subcommands
2
+ # https://github.com/erikhuda/thor/pull/330
3
+
4
+ class Thor
5
+ class << self
6
+ attr_accessor :parent_class
7
+
8
+ def basename2(subcommand = false)
9
+ bn = parent_class && parent_class.basename2
10
+ bn2 = basename
11
+ ns = self.namespace.split(':').last
12
+ bn ? (subcommand ? bn : "#{bn} #{ns}") : bn2
13
+ end
14
+
15
+ def banner(command, namespace = nil, subcommand = false)
16
+ "#{basename2(subcommand)} #{command.formatted_usage(self, $thor_runner, subcommand)}"
17
+ end
18
+
19
+ alias :old_subcommand :subcommand
20
+
21
+ def subcommand(subcommand, subcommand_class)
22
+ subcommand_class.parent_class = self
23
+ old_subcommand(subcommand, subcommand_class)
24
+ end
25
+ end
26
+ end
@@ -1,3 +1,3 @@
1
1
  module CloudstackCli
2
- VERSION = "1.2.4"
2
+ VERSION = "1.2.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloudstack-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.4
4
+ version: 1.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nik Wolfgramm
@@ -122,6 +122,7 @@ files:
122
122
  - lib/cloudstack-cli/commands/zone.rb
123
123
  - lib/cloudstack-cli/helper.rb
124
124
  - lib/cloudstack-cli/option_resolver.rb
125
+ - lib/cloudstack-cli/thor_patch.rb
125
126
  - lib/cloudstack-cli/version.rb
126
127
  - test/infrastructure_stack.yaml
127
128
  - test/stack_example.json