foreman_azure_rm 2.2.6 → 2.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4c5017c30e0067522ca79641d307a2aaef0073ee2c60eb2ec26bf7ca88c72047
4
- data.tar.gz: e62b30ff6d8594136a724e0995ba7b5de4b14832cd015996d3186f0a1f4daaff
3
+ metadata.gz: 17a61e0daa9ad81dba459c8976da8712fae9a1ff4b52aeb85c6a04f7aa9d5be8
4
+ data.tar.gz: e7469e41dcf4327afaf31de2b37be1f9119700419d6c22319df282e1e816451d
5
5
  SHA512:
6
- metadata.gz: 944bbf2ce53335d33f7ed2f97ac4658408546458103be05ce6cd94bb7cc8f273d49d233adf2cbd7a137154437c0188749123e8ec73eff4d446b59a4d7f068677
7
- data.tar.gz: 676ed07015b420ace8897695ba252f387577ab4b2b55d1bff62b97381ff3b53aac6ac57af99104351ec068af01af44f90770a54100a7aef1de148be039538278
6
+ metadata.gz: 3cfe08678137c3c193362eec308091a1a7a45cc359e70590228be1a1022090b8041dac66ec5bc2a8adeab945615b45c0df5b9b2be73c6239aef73a21503eb7ce
7
+ data.tar.gz: 22d9c5ce4049fe7546dc48bdfdb382b61f5f7f3afa961ef328da2a92eb64bee4c3bbbfe3abae40eb80fcbdb183712d32b2e7b7e27f76d15bc785272c6d4d6cad
@@ -123,7 +123,7 @@ module ForemanAzureRm
123
123
  def create_nics(region, args = {})
124
124
  nics = []
125
125
  args[:interfaces_attributes].each do |nic, attrs|
126
- private_ip = Foreman::Cast.to_bool(attrs[:private_ip])
126
+ private_ip = ActiveRecord::Type::Boolean.new.deserialize(attrs[:private_ip])
127
127
  priv_ip_alloc = if private_ip
128
128
  NetworkModels::IPAllocationMethod::Static
129
129
  else
@@ -145,7 +145,7 @@ module ForemanAzureRm
145
145
  volumes: vols,
146
146
  script_command: opts[:script_command],
147
147
  script_uris: opts[:script_uris],
148
- nvidia_gpu_extension: Foreman::Cast.to_bool(opts[:nvidia_gpu_extension]),
148
+ nvidia_gpu_extension: ActiveRecord::Type::Boolean.new.deserialize(opts[:nvidia_gpu_extension]),
149
149
  )
150
150
  end
151
151
 
@@ -291,16 +291,10 @@ module ForemanAzureRm
291
291
 
292
292
  if args[:platform] == 'Linux'
293
293
  if args[:password].present? && !args[:ssh_key_data].present?
294
- # Any change to sudoers_cmd and formation of new
295
- # args[:script_command] must be accordingly changed
296
- # in script_command method in AzureRmCompute class
297
- sudoers_cmd = "$echo #{args[:password]} | sudo -S echo '\"#{args[:username]}\" ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/waagent"
298
294
  if args[:script_command].present?
299
295
  # to run the script_cmd given through form as username
300
296
  user_command = args[:script_command]
301
- args[:script_command] = sudoers_cmd + " ; su - \"#{args[:username]}\" -c \"#{user_command}\""
302
- else
303
- args[:script_command] = sudoers_cmd
297
+ args[:script_command] = "su - \"#{args[:username]}\" -c \"#{user_command}\""
304
298
  end
305
299
  disable_password_auth = false
306
300
  elsif args[:ssh_key_data].present? && !args[:password].present?
@@ -334,7 +328,7 @@ module ForemanAzureRm
334
328
  )
335
329
  logger.debug "Virtual Machine #{args[:vm_name]} Created Successfully."
336
330
  # request NVIDIA GPU driver and CUDA stack
337
- if Foreman::Cast.to_bool(args[:nvidia_gpu_extension])
331
+ if ActiveRecord::Type::Boolean.new.deserialize(args[:nvidia_gpu_extension])
338
332
  create_vm_nvidia_gpu_extension(region, args)
339
333
  end
340
334
  # as this extension may contains postinstall script, call it after others
@@ -348,7 +342,7 @@ module ForemanAzureRm
348
342
  volumes: vm_disks(vm),
349
343
  script_command: user_command,
350
344
  script_uris: args[:script_uris],
351
- nvidia_gpu_extension: Foreman::Cast.to_bool(args[:nvidia_gpu_extension]),
345
+ nvidia_gpu_extension: ActiveRecord::Type::Boolean.new.deserialize(args[:nvidia_gpu_extension]),
352
346
  tags: args[:tags],
353
347
  )
354
348
  rescue RuntimeError => e
@@ -1,3 +1,3 @@
1
1
  module ForemanAzureRm
2
- VERSION = '2.2.6'.freeze
2
+ VERSION = '2.2.7'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_azure_rm
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.6
4
+ version: 2.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aditi Puntambekar
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2021-11-11 00:00:00.000000000 Z
13
+ date: 2022-09-08 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: azure_mgmt_resources