Skip to content

Commit

Permalink
nova_flavors: fix punctuation handling in nova resource class
Browse files Browse the repository at this point in the history
  • Loading branch information
skrobul committed Nov 25, 2024
1 parent 0f25402 commit 0050224
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def baremetal_nova_resource_class(self):
https://docs.openstack.org/ironic/latest/install/configure-nova-flavors.html
"""
converted_name = re.sub(r"[^\w]", "", self.stripped_name).upper()
converted_name = re.sub(r"[^\w]", "_", self.stripped_name).upper()
return f"resources:CUSTOM_BAREMETAL_{converted_name}"

@property
Expand Down
3 changes: 2 additions & 1 deletion python/understack-flavor-matcher/tests/test_flavor_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,8 @@ def test_memory_gib(valid_yaml):
def test_baremetal_nova_resource_class(valid_yaml):
flv = FlavorSpec.from_yaml(valid_yaml)
assert (
flv.baremetal_nova_resource_class == "resources:CUSTOM_BAREMETAL_GP2ULTRAMEDIUM"
flv.baremetal_nova_resource_class
== "resources:CUSTOM_BAREMETAL_GP2_ULTRAMEDIUM"
)


Expand Down

0 comments on commit 0050224

Please sign in to comment.