Skip to content

Commit

Permalink
fix: revert changes in metadata api endpoint (#646)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidgamez committed Jul 31, 2024
1 parent 17f5971 commit 5960c10
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions api/src/feeds/impl/metadata_api_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,13 @@ def get_metadata(
# Create a configparser object
config = configparser.ConfigParser()

# The version_info file is in api/src subdirectory. We're not sure which directory this code is running
# (and it's different for tests), but we will assume api is in the path.
current_directory = os.getcwd()

root_directory = current_directory.split("/api", 1)[0]
if root_directory is None:
raise Exception(
"Cannot find version_info file. "
+ f"Cannot find api in the path to the current working directory = {current_directory}"
)
file = root_directory + "/api/src/version_info"
file = "version_info"
# The config file is on api/src. Normally the cwd is api/src, but with unit tests it's api. In that case
# add /src
if current_directory.endswith("api"):
file = os.path.join("src", file)

# Read the properties file. This file should have been filled as part of the build.
config.read(file)
Expand Down

0 comments on commit 5960c10

Please sign in to comment.