knife-azure 2.0.1 → 2.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/azure/resource_management/ARM_interface.rb +20 -18
- data/lib/knife-azure/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dbfc2fd98f5a6a8fe8731a175f4b847227c89df5276b1cc267fd8c05f0ecc3c8
|
4
|
+
data.tar.gz: 3a380c98f7769bdcffab91f6fb5ace04a4420d83cc59d822739374a8e14f90c9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c5735571def936b1dd953ca3d3df2ad2662217d5b517c605720b19116af1f73147963bde7e687cd77efea1620b9afc517f56f9f0c8c3c09d3811d55bfa7ae924
|
7
|
+
data.tar.gz: 5b938d5a39b4497a61816d1ac015a039169293b86a0f0c71dd007462c9fb75c9b1ee96a6fe7e3d15ddcb7a99ea89e17ecc357981119dcd6303d6e52ea1016797
|
@@ -211,13 +211,13 @@ module Azure
|
|
211
211
|
def virtual_machine_exist?(resource_group_name, vm_name)
|
212
212
|
compute_management_client.virtual_machines.get(resource_group_name, vm_name)
|
213
213
|
true
|
214
|
-
rescue MsRestAzure::AzureOperationError =>
|
215
|
-
if
|
216
|
-
err_json = JSON.parse(
|
214
|
+
rescue MsRestAzure::AzureOperationError => e
|
215
|
+
if e.body
|
216
|
+
err_json = JSON.parse(e.response.body)
|
217
217
|
if err_json["error"]["code"] == "ResourceNotFound"
|
218
218
|
return false
|
219
219
|
else
|
220
|
-
raise
|
220
|
+
raise e
|
221
221
|
end
|
222
222
|
end
|
223
223
|
end
|
@@ -225,13 +225,13 @@ module Azure
|
|
225
225
|
def security_group_exist?(resource_group_name, security_group_name)
|
226
226
|
network_resource_client.network_security_groups.get(resource_group_name, security_group_name)
|
227
227
|
true
|
228
|
-
rescue MsRestAzure::AzureOperationError =>
|
229
|
-
if
|
230
|
-
err_json = JSON.parse(
|
228
|
+
rescue MsRestAzure::AzureOperationError => e
|
229
|
+
if e.body
|
230
|
+
err_json = JSON.parse(e.response.body)
|
231
231
|
if err_json["error"]["code"] == "ResourceNotFound"
|
232
232
|
return false
|
233
233
|
else
|
234
|
-
raise
|
234
|
+
raise e
|
235
235
|
end
|
236
236
|
end
|
237
237
|
end
|
@@ -443,9 +443,9 @@ module Azure
|
|
443
443
|
vm_ext.name,
|
444
444
|
vm_ext
|
445
445
|
)
|
446
|
-
rescue Exception =>
|
446
|
+
rescue Exception => e
|
447
447
|
Chef::Log.error("Failed to create the Virtual Machine Extension -- exception being rescued.")
|
448
|
-
common_arm_rescue_block(
|
448
|
+
common_arm_rescue_block(e)
|
449
449
|
end
|
450
450
|
|
451
451
|
vm_extension
|
@@ -497,15 +497,17 @@ module Azure
|
|
497
497
|
end
|
498
498
|
Chef::Log.debug(error.response.body)
|
499
499
|
else
|
500
|
-
begin
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
Chef::Log.debug("#{error.backtrace.join("\n")}")
|
500
|
+
message = begin
|
501
|
+
JSON.parse(error.message)
|
502
|
+
rescue JSON::ParserError => e
|
503
|
+
error.message
|
504
|
+
end
|
505
|
+
ui.error(message)
|
506
|
+
Chef::Log.debug(message)
|
508
507
|
end
|
508
|
+
rescue Exception => e
|
509
|
+
ui.error("Something went wrong. Please use -VV option for more details.")
|
510
|
+
Chef::Log.debug(error.backtrace.join("\n").to_s)
|
509
511
|
end
|
510
512
|
end
|
511
513
|
end
|
data/lib/knife-azure/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: knife-azure
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Barry Davis
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2019-
|
12
|
+
date: 2019-09-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: chef
|