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

Remove flawed dictionary version check. Fixes nasa/fprime#2231 #156

Merged
merged 1 commit into from
Dec 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 0 additions & 36 deletions src/fprime_gds/common/loaders/xml_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,23 +117,6 @@ def get_xml_tree(path):
# Parse xml and get element tree object we can retrieve data from
element_tree = etree.parse(fd, parser=xml_parser)
root = element_tree.getroot()

# Check version of the XML before continuing. Versions weren't published before 1.5.4. Only check major minor
# and point versions to allow for development versions to be allowed.
dict_version_string = root.attrib.get("framework_version", "1.5.4")
digits = []
# Process through the tokens of the version until we hit something that is not an int
for token in dict_version_string.split("."):
try:
digits.append(int(token))
except ValueError:
break
dict_version = tuple(digits)
if (
dict_version < MINIMUM_SUPPORTED_FRAMEWORK_VERSION
or dict_version > MAXIMUM_SUPPORTED_FRAMEWORK_VERSION
):
raise UnsupportedDictionaryVersionException(dict_version)
return root

@staticmethod
Expand Down Expand Up @@ -401,22 +384,3 @@ def parse_type(self, type_name, xml_item, xml_tree, context=None):
raise exceptions.GseControllerParsingException(
msg
)


class UnsupportedDictionaryVersionException(Exception):
"""Dictionary is of unsupported version"""

def __init__(self, version):
"""Create a dictionary of a specific version"""

def pretty(version_tuple):
"""Pretty print version"""
return ".".join([str(item) for item in version_tuple])

super().__init__(
"Dictionary version {} is not in supported range: {}-{}. Please upgrade fprime-gds.".format(
pretty(version),
pretty(MINIMUM_SUPPORTED_FRAMEWORK_VERSION),
pretty(MAXIMUM_SUPPORTED_FRAMEWORK_VERSION),
)
)
Loading