-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle VPC flavor with nil :disks value #475
Conversation
Use safe navigation to parse a nil :disks value.
Backported to
|
Handle VPC flavor with nil :disks value (cherry picked from commit 0f3d095)
@jaywcarman A conflict occurred during the backport of this pull request to If this pull request is based on another pull request that has not been marked for backport, add the appropriate labels to the other pull request. Otherwise, please create a new pull request direct to the Conflict details: diff --cc app/models/manageiq/providers/ibm_cloud/inventory/parser/vpc.rb
index 6a37fe4,7999a58..0000000
--- a/app/models/manageiq/providers/ibm_cloud/inventory/parser/vpc.rb
+++ b/app/models/manageiq/providers/ibm_cloud/inventory/parser/vpc.rb
@@@ -179,14 -182,14 +179,18 @@@ class ManageIQ::Providers::IbmCloud::In
def flavors
collector.flavors.each do |flavor|
memory = flavor&.dig(:memory, :value)
++<<<<<<< HEAD
+ memory_mb = Integer(memory) * 1024 if memory
++=======
+ disk = flavor[:disks]&.first&.dig(:size, :value) || 0
++>>>>>>> 0f3d095 (Merge pull request #475 from jaywcarman/vpc_flavor_disks_safe_nav)
persister.flavors.build(
- :ems_ref => flavor[:name],
- :name => flavor[:name],
- :cpu_total_cores => flavor&.dig(:vcpu_count, :value),
- :memory => memory&.gigabytes,
- :root_disk_size => disk&.gigabytes,
- :enabled => true
+ :ems_ref => flavor[:name],
+ :name => flavor[:name],
+ :cpus => flavor&.dig(:vcpu_count, :value),
+ :cpu_cores => flavor&.dig(:vcpu_count, :value),
+ :memory => memory_mb,
+ :enabled => true
)
end
end |
@Fryguy, looks like this bug wasn't introduced until master|8c5bf6f5|manageiq-providers-ibm_cloud$ git show 56e36dba99e352f514a207dba0fe2f733ae6ebae -- app/models/manageiq/providers/ibm_cloud/inventory/parser/vpc.rb
commit 56e36dba99e352f514a207dba0fe2f733ae6ebae
Author: nasark <nasarak_786@hotmail.com>
Date: Wed Nov 3 10:20:15 2021 -0400
add resize vm functionality
diff --git a/app/models/manageiq/providers/ibm_cloud/inventory/parser/vpc.rb b/app/models/manageiq/providers/ibm_cloud/inventory/parser/vpc.rb
index 7f7133a6..4bd9b0f9 100644
--- a/app/models/manageiq/providers/ibm_cloud/inventory/parser/vpc.rb
+++ b/app/models/manageiq/providers/ibm_cloud/inventory/parser/vpc.rb
@@ -182,12 +182,13 @@ class ManageIQ::Providers::IbmCloud::Inventory::Parser::VPC < ManageIQ::Provider
def flavors
collector.flavors.each do |flavor|
memory = flavor&.dig(:memory, :value)
- memory_mb = Integer(memory) * 1024 if memory
+ disk = flavor[:disks].first&.dig(:size, :value) || 0
persister.flavors.build(
:ems_ref => flavor[:name],
:name => flavor[:name],
:cpu_total_cores => flavor&.dig(:vcpu_count, :value),
- :memory => memory_mb,
+ :memory => memory&.gigabytes,
+ :root_disk_size => disk&.gigabytes,
:enabled => true
)
end
master|8c5bf6f5|manageiq-providers-ibm_cloud$ git fetch upstream && git branch -r -l 'upstream/*' --contains 56e36dba99e352f514a207dba0fe2f733ae6ebae
upstream/HEAD -> upstream/master
upstream/master
upstream/najdorf
upstream/oparin
upstream/petrosian
upstream/quinteros
upstream/renovate/configure |
I noticed VPC refresh failing (us-south region) due to:
I'm not sure if this Flavor is new or something (why wasn't it failing before?), but it does indeed have a
null
disks value: