Skip to content

Commit

Permalink
fix(#5219): os_version fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
pro-akim committed May 2, 2024
1 parent abccdea commit 7534151
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions deployability/modules/testing/tests/helpers/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,19 +198,18 @@ def get_os_version_from_inventory(inventory_path) -> str:
Returns:
str: os version
"""
os_type = HostInformation.get_os_type(inventory_path)

logger.error(inventory_path)
if 'manager' in inventory_path:
os_version = re.search(r".*?/manager-.*?-.*?-(.*?)-.*?/inventory.yaml", inventory_path).group(1)
match = re.search(r".*?/manager-.*?-.*?-(.*?)-.*?/inventory.yaml", inventory_path)
elif 'agent' in inventory_path:
os_version = re.search(r".*?/agent-.*?-.*?-(.*?)-.*?/inventory.yaml", inventory_path).group(1)
match = re.search(r".*?/agent-.*?-.*?-(.*?)-.*?/inventory.yaml", inventory_path)
elif 'central_components' in inventory_path:
os_version = re.search(r".*?/central_components-.*?-.*?-(.*?)-.*?/inventory.yaml", inventory_path).group(1)
return os_version
match = re.search(r".*?/central_components-.*?-.*?-(.*?)-.*?/inventory.yaml", inventory_path)
if match:
return match.group(1)
else:
return None


@staticmethod
def get_current_dir(inventory_path) -> str:
"""
Expand Down

0 comments on commit 7534151

Please sign in to comment.