Skip to content

Commit

Permalink
Merge pull request #466 from PanDAWMS/config_json
Browse files Browse the repository at this point in the history
Logic for JSON column in ATLAS_PANDA.config
  • Loading branch information
fbarreir authored Dec 9, 2024
2 parents 7f9f6ec + 24e1e25 commit ed6dcc1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions pandaserver/taskbuffer/OraDBProxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ def getConfigValue(self, component, key, app="pandaserver", vo=None):
methodName = comment.split(" ")[-2].split(".")[-1]
varMap = {":component": component, ":key": key, ":app": app}
sql = """
SELECT value, type FROM ATLAS_PANDA.CONFIG
SELECT value, value_json, type FROM ATLAS_PANDA.CONFIG
WHERE component=:component
AND key=:key
AND app=:app
Expand All @@ -435,7 +435,7 @@ def getConfigValue(self, component, key, app="pandaserver", vo=None):
self.cur.execute(sql + comment, varMap)

try:
value_str, type = self.cur.fetchone()
value_str, value_json_str, type = self.cur.fetchone()
except TypeError:
error_message = f"Specified key={key} not found for component={component} app={app}"
_logger.debug(error_message)
Expand All @@ -453,6 +453,8 @@ def getConfigValue(self, component, key, app="pandaserver", vo=None):
return True
else:
return False
elif type.lower() == "json":
return json.loads(value_json_str)
else:
raise ValueError
except ValueError:
Expand Down
2 changes: 1 addition & 1 deletion pandaserver/taskbuffer/PandaDBSchemaInfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ class PandaDBSchemaInfo:
schema_version = None

def method(self):
schema_version = "0.0.22"
schema_version = "0.0.23"
_logger.debug(f"PanDA schema version required for Server is : {schema_version}")
return schema_version

0 comments on commit ed6dcc1

Please sign in to comment.