knife-azure 3.0.1 → 3.0.4

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: 0134b6b6ce8f4a5ce3e7097fdcf9c04f83259427e8201b3282a29823184d0ccf
4
- data.tar.gz: bb831d03702e772f831909c4b644ed3c3b937cf7e5eef32b4f7e837b3be2e371
3
+ metadata.gz: 17210f56bc1b6b7efd7152512c8ee5c416d0eb6afed2139f757bbd96f20baaa8
4
+ data.tar.gz: 3cba997f30e540035c9b4495326c09e70d45a3c0d7c9f84d01377168bf73837f
5
5
  SHA512:
6
- metadata.gz: 5c225c2e51196e543ca85f71b54bf3bb35cbf51dc4078f16e2f2b665118c630cbade53f677b1591698acdbc39a6456927845362c8d8d29b587456c6dc58d684a
7
- data.tar.gz: fa4ddcb03f10e04a7ad44b20c9fc1072a54a36d03469d4245495914444fedab3853d8f4f1e98409edda6752370c3d191f28dd09e0a5c7fe67a87cac112ba4c27
6
+ metadata.gz: 884f5d06b3ad5159a97a81434e508185c64c0850f135b2b71094f70076aeecc0b7670f58d83215531344b903820caefeacec85aee53f7d254cbbbe22eca21548
7
+ data.tar.gz: f57c4e8b5cad7a9437a4292c1c41b2ff668d9c42f32c322ef1f1ac7fe87d735b8fff7c8d2859500958f3e11616487e0606960f75d39c7948fbdc0fdb46723924
@@ -323,7 +323,7 @@ module Azure
323
323
  else
324
324
  ui.log("Creating ResourceGroup....\n\n")
325
325
  resource_group = create_resource_group(params)
326
- Chef::Log.info("ResourceGroup creation successfull.")
326
+ Chef::Log.info("ResourceGroup creation successful.")
327
327
  Chef::Log.info("Resource Group name is: #{resource_group.name}")
328
328
  Chef::Log.info("Resource Group ID is: #{resource_group.id}")
329
329
  end
@@ -355,7 +355,7 @@ module Azure
355
355
 
356
356
  ui.log("Creating Virtual Machine....")
357
357
  deployment = create_virtual_machine_using_template(params)
358
- ui.log("Virtual Machine creation successfull.") unless deployment.nil?
358
+ ui.log("Virtual Machine creation successful.") unless deployment.nil?
359
359
 
360
360
  unless deployment.nil?
361
361
  ui.log("Deployment name is: #{deployment.name}")
@@ -422,8 +422,7 @@ module Azure
422
422
  deploy_params = Deployment.new
423
423
  deploy_params.properties = deploy_prop
424
424
 
425
- deployment = resource_management_client.deployments.create_or_update(params[:azure_resource_group_name], "#{params[:azure_vm_name]}_deploy", deploy_params)
426
- deployment
425
+ resource_management_client.deployments.create_or_update(params[:azure_resource_group_name], "#{params[:azure_vm_name]}_deploy", deploy_params)
427
426
  end
428
427
 
429
428
  def create_vm_extension(params)
@@ -467,8 +466,7 @@ module Azure
467
466
  params[:chef_extension]
468
467
  ).last.name
469
468
  ext_version_split_values = ext_version.split(".")
470
- ext_version = ext_version_split_values[0] + "." + ext_version_split_values[1]
471
- ext_version
469
+ ext_version_split_values[0] + "." + ext_version_split_values[1]
472
470
  end
473
471
 
474
472
  def delete_resource_group(resource_group_name)
@@ -123,8 +123,8 @@ module Azure
123
123
  def target_name
124
124
  # cmdkey command is used for accessing windows credential manager.
125
125
  # Multiple credentials get created in windows credential manager for a single Azure account in xplat-cli
126
- # One of them is for common tanent id, which can't be used
127
- # Others end with --0-x,--1-x,--2-x etc, where x represents the total no. of credentails across which the token is divided
126
+ # One of them is for common tenant id, which can't be used
127
+ # Others end with --0-x,--1-x,--2-x etc, where x represents the total no. of credentials across which the token is divided
128
128
  # The one ending with --0-x has the complete accessToken in the credentialBlob.
129
129
  # Refresh Token is split across both credentials (ending with --0-x and --1-x).
130
130
  # Xplat splits the credentials based on the number of bytes of the tokens.
@@ -150,8 +150,7 @@ module Azure
150
150
 
151
151
  # If "azure login" is run for multiple users, there will be multiple credentials
152
152
  # Picking up the latest logged in user's credentials
153
- latest_target = latest_credential_target target_names
154
- latest_target
153
+ latest_credential_target target_names
155
154
  end
156
155
 
157
156
  def latest_credential_target(targets)
@@ -85,7 +85,7 @@ module Azure
85
85
  ca.add_extension(ef.create_extension("keyUsage", "keyCertSign, cRLSign", true))
86
86
  ca.add_extension(ef.create_extension("subjectKeyIdentifier", "hash", false))
87
87
  ca.add_extension(ef.create_extension("authorityKeyIdentifier", "keyid:always", false))
88
- ca.sign(key, OpenSSL::Digest::SHA256.new)
88
+ ca.sign(key, OpenSSL::Digest.new("SHA256"))
89
89
  # Generate the SHA1 fingerprint of the der format of the X 509 certificate
90
90
  @fingerprint = OpenSSL::Digest::SHA1.new(ca.to_der)
91
91
  # Create the pfx format of the certificate
@@ -216,7 +216,7 @@ module Azure
216
216
  cert.add_extension(ef.create_extension("subjectKeyIdentifier", "hash", false))
217
217
  cert.add_extension(ef.create_extension("authorityKeyIdentifier", "keyid:always", false))
218
218
  cert.add_extension(ef.create_extension("extendedKeyUsage", "1.3.6.1.5.5.7.3.1", false))
219
- cert.sign(rsa_key, OpenSSL::Digest::SHA1.new)
219
+ cert.sign(rsa_key, OpenSSL::Digest.new("SHA1"))
220
220
  @thumbprint = OpenSSL::Digest::SHA1.new(cert.to_der)
221
221
  cert
222
222
  end
@@ -51,7 +51,7 @@ class Chef
51
51
  long: "--delete-resource-group",
52
52
  boolean: true,
53
53
  default: false,
54
- description: "Deletes corresponding resource group along with Vitual Machine."
54
+ description: "Deletes corresponding resource group along with Virtual Machine."
55
55
 
56
56
  # Extracted from Chef::Knife.delete_object, because it has a
57
57
  # confirmation step built in... By specifying the '--purge'
@@ -139,10 +139,10 @@ class Chef
139
139
  ext_params
140
140
  end
141
141
 
142
- def wait_until_extension_available(extension_deploy_start_time, extension_availaibility_wait_timeout)
143
- extension_availaibility_wait_time = ((Time.now - extension_deploy_start_time) / 60).round
144
- if extension_availaibility_wait_time <= extension_availaibility_wait_timeout
145
- ## extension availaibility wait time has not exceeded the maximum threshold set for the wait timeout ##
142
+ def wait_until_extension_available(extension_deploy_start_time, extension_availability_wait_timeout)
143
+ extension_availability_wait_time = ((Time.now - extension_deploy_start_time) / 60).round
144
+ if extension_availability_wait_time <= extension_availability_wait_timeout
145
+ ## extension availability wait time has not exceeded the maximum threshold set for the wait timeout ##
146
146
  my_role = nil
147
147
  sleep_and_wait = false
148
148
  deployment = fetch_deployment
@@ -178,12 +178,12 @@ class Chef
178
178
  sleep 30
179
179
  wait_until_extension_available(
180
180
  extension_deploy_start_time,
181
- extension_availaibility_wait_timeout
181
+ extension_availability_wait_timeout
182
182
  )
183
183
  end
184
184
  else
185
- ## extension availaibility wait time exceeded maximum threshold set for the wait timeout ##
186
- raise "\nUnable to fetch chef-client run logs as Chef Extension seems to be unavailable even after #{extension_availaibility_wait_timeout} minutes of its deployment.\n"
185
+ ## extension availability wait time exceeded maximum threshold set for the wait timeout ##
186
+ raise "\nUnable to fetch chef-client run logs as Chef Extension seems to be unavailable even after #{extension_availability_wait_timeout} minutes of its deployment.\n"
187
187
  end
188
188
  end
189
189
  end
@@ -292,9 +292,7 @@ class Chef
292
292
 
293
293
  def fetch_deployment
294
294
  deployment_name = service.deployment_name(config[:azure_dns_name])
295
- deployment = service.deployment("hostedservices/#{config[:azure_dns_name]}/deployments/#{deployment_name}")
296
-
297
- deployment
295
+ service.deployment("hostedservices/#{config[:azure_dns_name]}/deployments/#{deployment_name}")
298
296
  end
299
297
 
300
298
  def fetch_role
@@ -93,8 +93,7 @@ class Chef
93
93
  token_details = token_details_for_linux
94
94
  end
95
95
 
96
- token_details = check_token_validity(token_details)
97
- token_details
96
+ check_token_validity(token_details)
98
97
  end
99
98
 
100
99
  def get_azure_cli_version
@@ -122,8 +121,7 @@ class Chef
122
121
  home_dir = File.expand_path("~")
123
122
  file = File.read(home_dir + "/.azure/accessTokens.json")
124
123
  file = JSON.parse(file)
125
- token_details = { tokentype: file[-1]["tokenType"], user: file[-1]["userId"], token: file[-1]["accessToken"], clientid: file[-1]["_clientId"], expiry_time: file[-1]["expiresOn"], refreshtoken: file[-1]["refreshToken"] }
126
- token_details
124
+ { tokentype: file[-1]["tokenType"], user: file[-1]["userId"], token: file[-1]["accessToken"], clientid: file[-1]["_clientId"], expiry_time: file[-1]["expiresOn"], refreshtoken: file[-1]["refreshToken"] }
127
125
  end
128
126
 
129
127
  def is_token_valid?(token_details)
@@ -219,7 +217,7 @@ class Chef
219
217
  def msg_server_summary(server)
220
218
  puts "\n\n"
221
219
  if server.provisioningstate == "Succeeded"
222
- Chef::Log.info("Server creation went successfull.")
220
+ Chef::Log.info("Server creation went successful.")
223
221
  puts "\nServer Details are:\n"
224
222
 
225
223
  msg_pair("Server ID", server.id)
@@ -240,7 +238,7 @@ class Chef
240
238
  puts "\n\n"
241
239
 
242
240
  if server.resources.provisioning_state == "Succeeded"
243
- Chef::Log.info("Server Extension creation went successfull.")
241
+ Chef::Log.info("Server Extension creation went successful.")
244
242
  puts "\nServer Extension Details are:\n"
245
243
 
246
244
  msg_pair("Server Extension ID", server.resources.id)
@@ -278,10 +276,10 @@ class Chef
278
276
 
279
277
  if !is_image_windows?
280
278
  if (config[:azure_vm_name].match /^(?=.*[a-zA-Z-])([a-zA-z0-9-]{1,64})$/).nil?
281
- raise ArgumentError, "VM name can only contain alphanumeric and hyphen(-) characters and maximun length cannot exceed 64 charachters."
279
+ raise ArgumentError, "VM name can only contain alphanumeric and hyphen(-) characters and maximum length cannot exceed 64 characters."
282
280
  end
283
281
  elsif (config[:azure_vm_name].match /^(?=.*[a-zA-Z-])([a-zA-z0-9-]{1,15})$/).nil?
284
- raise ArgumentError, "VM name can only contain alphanumeric and hyphen(-) characters and maximun length cannot exceed 15 charachters."
282
+ raise ArgumentError, "VM name can only contain alphanumeric and hyphen(-) characters and maximum length cannot exceed 15 characters."
285
283
  end
286
284
 
287
285
  if config[:server_count].to_i > 5
@@ -17,7 +17,7 @@
17
17
 
18
18
  module Knife
19
19
  module Azure
20
- VERSION = "3.0.1".freeze
20
+ VERSION = "3.0.4".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: 3.0.1
4
+ version: 3.0.4
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: 2020-05-15 00:00:00.000000000 Z
12
+ date: 2020-08-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: chef