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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a4992071460b92c0325d97a11cfd76184cfcd07f771404edf78ed6362ef576fb
4
- data.tar.gz: 7041fd59542fc9ec2808a3898fa6a60a5d72877ad0539920b383eb07dac9d72d
3
+ metadata.gz: dbfc2fd98f5a6a8fe8731a175f4b847227c89df5276b1cc267fd8c05f0ecc3c8
4
+ data.tar.gz: 3a380c98f7769bdcffab91f6fb5ace04a4420d83cc59d822739374a8e14f90c9
5
5
  SHA512:
6
- metadata.gz: 65dd03f7cac3721756a331614b7f8275481a22cf243e10d5a6ebc74e0582533258190ff7aca0ff54927ab1fb04ba5e4b403df634e82709a914a934f8fed52363
7
- data.tar.gz: f3510839a3f84ed226b52527253f3aa9ad72c5dcf9ce9be23c3a17b8969906e92e7235445024f0ad1a2494d037983dd94d62098bda1b3b6e339045d93929ea66
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 => error
215
- if error.body
216
- err_json = JSON.parse(error.response.body)
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 error
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 => error
229
- if error.body
230
- err_json = JSON.parse(error.response.body)
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 error
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 => error
446
+ rescue Exception => e
447
447
  Chef::Log.error("Failed to create the Virtual Machine Extension -- exception being rescued.")
448
- common_arm_rescue_block(error)
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
- JSON.parse(error.message)
502
- Chef::Log.debug("#{error.message}")
503
- rescue JSON::ParserError => e
504
- ui.error("#{error.message}")
505
- end
506
- ui.error("Something went wrong. Please use -VV option for more details.")
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
@@ -17,7 +17,7 @@
17
17
 
18
18
  module Knife
19
19
  module Azure
20
- VERSION = "2.0.1".freeze
20
+ VERSION = "2.0.2".freeze
21
21
  MAJOR, MINOR, TINY = VERSION.split(".")
22
22
  end
23
23
  end
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.1
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-08-20 00:00:00.000000000 Z
12
+ date: 2019-09-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: chef