Skip to content
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

Normalize ol_x64 as oracle OS #23290

Merged
merged 2 commits into from
Dec 4, 2024
Merged

Conversation

nasark
Copy link
Member

@nasark nasark commented Dec 3, 2024

oVirt is returning ol_8x64 and ol_9x64 which is not being recognized as Oracle

For this issue: ManageIQ/manageiq-providers-ovirt#683

3.1.3 :002 > OperatingSystem.normalize_os_name("ol_8x64")
 => "linux_oracle" 

@miq-bot add_label bug
@miq-bot assign @Fryguy
@miq-bot add_reviewer @agrare, @Fryguy

@@ -28,7 +28,7 @@ class OperatingSystem < ApplicationRecord
["linux_debian", %w[debian]],
["linux_esx", %w[vmnixx86 vmwareesxserver esxserver vmwareesxi]],
["linux_solaris", %w[solaris]],
["linux_oracle", %w[oracle]],
["linux_oracle", %w[oracle ol]],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to be clear, is this a substring match or a "starts_with" match? I'm asking because ol seems very generic and could accidetally trip on certain strings.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additionally can you add some test cases for this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

@Fryguy Fryguy Dec 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah so a future "FooLinux" will match because it's just ol in the middle. Might be nice to allow regexes in that list, and then we can use .match? if it's a regex. Then you can do something like /^ol_/

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could also have a pre-parse step in the provider for weird cases like this

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added oracle cases to the specs and regex matching

@nasark nasark force-pushed the normalize_ol_oracle branch from e60519e to 488a238 Compare December 4, 2024 18:57
@Fryguy Fryguy merged commit a2a7b2d into ManageIQ:master Dec 4, 2024
8 checks passed
@Fryguy
Copy link
Member

Fryguy commented Jan 7, 2025

Backported to radjabov in commit f28ac53.

commit f28ac53dcc19fdec973165e3a28f5e29fdde24c0
Author: Jason Frey <fryguy9@gmail.com>
Date:   Wed Dec 4 15:21:04 2024 -0500

    Merge pull request #23290 from nasark/normalize_ol_oracle
    
    Normalize ol_x64 as oracle OS
    
    (cherry picked from commit a2a7b2de91d08ce54e1acafeca35a420de369703)

Fryguy added a commit that referenced this pull request Jan 7, 2025
Normalize ol_x64 as oracle OS

(cherry picked from commit a2a7b2d)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants