cloudstack-cli 1.2.4 → 1.2.5
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 99141439bf28aa5016f37c7f0c177724c60a26c6
|
4
|
+
data.tar.gz: 1241704a4a4737469786b5e1f7a7d90deba16c54
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 073ac88981b9a4a0e8b355f5a476881d084a41838e04a8261dcf86993e8650874571706419ef68d64e1c7f2959a17e87a772fde3debef4dc172befec62f89190
|
7
|
+
data.tar.gz: a9de0b7fa807eafd2164fd1d4c6ca222cde76d8a0cea41ca8ce639a0fd49407e21b5d5ce227cd992b0a920f2173711296d829d2386f160e054e84567d7797718
|
data/Gemfile.lock
CHANGED
data/lib/cloudstack-cli/base.rb
CHANGED
@@ -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} (#{
|
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(
|
@@ -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
|
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
|
+
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
|