Skip to content

Commit

Permalink
Fix ImportError in tests for almalinux package
Browse files Browse the repository at this point in the history
  • Loading branch information
bklvsky committed May 16, 2024
1 parent 9fe4487 commit 016cbd2
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions alws/utils/oval_add_al8_gpg_keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,10 @@
from copy import deepcopy
from typing import Any, Dict, List, Optional, Tuple

from almalinux.liboval.composer import Composer, Definition, RpminfoState, RpminfoTest

try:
from almalinux.liboval.composer import Composer, Definition, RpminfoState, RpminfoTest
except ImportError:
pass

# AL8 GPG keys ids
GPG_KEYS = ['51d6647ec21ad6ea', '2ae81e8aced7258b']
Expand All @@ -105,7 +107,7 @@ def get_next(self):

def convert_sign_criterion_to_criteria(
root_criteria: List[Dict[str, Any]],
old_to_new_tests_map: Dict[str, List[RpminfoTest]],
old_to_new_tests_map: Dict[str, Any],
):
"""
Converts single sign criterion to criteria with multiple sign criterion with new tests.
Expand Down Expand Up @@ -151,7 +153,7 @@ def traverse_criteria(criteria_list):
return fixed_criteria


def get_first_available_ids(oval: Composer) -> Tuple[int, int]:
def get_first_available_ids(oval) -> Tuple[int, int]:
"""
Returns the first available test ID and state ID in the given Composer object.
Expand All @@ -169,8 +171,8 @@ def get_first_available_ids(oval: Composer) -> Tuple[int, int]:


def generate_gpg_keys_states(
states_counter: IdCounter, original_state: RpminfoState
) -> List[RpminfoState]:
states_counter, original_state
) -> List:
"""
Generate GPG keys states original state.
Expand All @@ -194,8 +196,8 @@ def generate_gpg_keys_states(


def get_new_tests_states(
oval: Composer,
) -> Tuple[List[RpminfoTest], List[RpminfoState], Dict[str, List[RpminfoTest]]]:
oval,
) -> Tuple[List, List, Dict[str, List]]:
"""
Generates new tests and states based on the given Oval Composer.
Expand Down Expand Up @@ -251,7 +253,7 @@ def get_new_tests_states(
return new_tests, new_states, old_to_new_test_map


def add_multiple_gpg_keys_to_oval(oval: Composer) -> Composer:
def add_multiple_gpg_keys_to_oval(oval):
"""
Adds support for multiple GPG keys to the given Oval Composer object.
Expand Down

0 comments on commit 016cbd2

Please sign in to comment.