cloudstack-cli 1.5.8 → 1.5.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/cloudstack-cli/commands/virtual_machine.rb +8 -9
- data/lib/cloudstack-cli/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c3825bffdc7d610ccd33d5ea01d48804ad3caeaf
|
4
|
+
data.tar.gz: 23e2821aaf38b61cbc98091a460f91e42d75ebb9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2eca64f2d69c815e19fbf7696087efc5a9a0f3f743acec88c5ea26c8b6a155510f1471b977bac4d6113dd351148abf393402698dec05ab4f938997be8c30a5cb
|
7
|
+
data.tar.gz: 7c43cc6ce81a7df4c7bffc94a967786fc76ff50da12951ec2eafda751e9da1541a83263c4c69870f525338e9687715b4a0b7c0f1244df99a540d680fab880ad2
|
data/Gemfile.lock
CHANGED
@@ -104,9 +104,7 @@ class VirtualMachine < CloudstackCli::Base
|
|
104
104
|
vm_options_to_params
|
105
105
|
say "Start deploying virtual machine#{"s" if names.size > 1}...", :green
|
106
106
|
jobs = names.map do |name|
|
107
|
-
if virtual_machine =
|
108
|
-
name: name, project_id: options[:project_id]
|
109
|
-
).first
|
107
|
+
if virtual_machine = find_vm_by_name(name)
|
110
108
|
say "virtual machine #{name} (#{virtual_machine["state"]}) already exists.", :yellow
|
111
109
|
job = {id: 0, name: "Create virtual machine #{name}", status: 3}
|
112
110
|
else
|
@@ -118,26 +116,27 @@ class VirtualMachine < CloudstackCli::Base
|
|
118
116
|
job
|
119
117
|
end
|
120
118
|
watch_jobs(jobs)
|
121
|
-
|
119
|
+
successful_jobs = jobs.count {|job| job[:status] == 1 }
|
120
|
+
if options[:port_rules].size > 0 && successful_jobs > 0
|
122
121
|
say "Create port forwarding rules...", :green
|
123
122
|
pjobs = []
|
124
123
|
names.each do |name|
|
125
|
-
|
126
|
-
create_port_rules(
|
124
|
+
vm = client.list_virtual_machines(name: name, project_id: options[:project_id]).first
|
125
|
+
create_port_rules(vm, options[:port_rules], false).each_with_index do |job_id, index|
|
127
126
|
pjobs << {
|
128
127
|
id: job_id,
|
129
|
-
name: "Create port forwarding ##{index + 1} rules for
|
128
|
+
name: "Create port forwarding ##{index + 1} rules for VM #{vm['name']}"
|
130
129
|
}
|
131
130
|
end
|
132
131
|
end
|
133
132
|
watch_jobs(pjobs)
|
134
133
|
end
|
135
134
|
say "Finished.", :green
|
136
|
-
if
|
135
|
+
if successful_jobs > 0 && yes?("Display password(s) for VM(s)? [y/N]:", :yellow)
|
137
136
|
table = []
|
138
137
|
jobs.each do |job|
|
139
138
|
data = client.query_async_job_result(jobid: job[:id])["jobresult"]["virtualmachine"] rescue nil
|
140
|
-
table << [data["name"], data["password"]] if data
|
139
|
+
table << ["#{data["name"]}:", data["password"]] if data
|
141
140
|
end
|
142
141
|
print_table table
|
143
142
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cloudstack-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nik Wolfgramm
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-10-
|
11
|
+
date: 2016-10-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|