env var naming conflict, qualified by prefix

This commit is contained in:
Ken Wiltshire
2024-11-01 14:24:17 -04:00
parent c86bc0edbe
commit caa24ee443

View File

@@ -32,11 +32,14 @@ class GraphStorage(BaseGraphStorage):
credetial_parts = ['URI', 'USERNAME','PASSWORD'] credetial_parts = ['URI', 'USERNAME','PASSWORD']
credentials_set = all(x in os.environ for x in credetial_parts ) credentials_set = all(x in os.environ for x in credetial_parts )
if credentials_set: if credentials_set:
URI = os.environ["URI"] URI = os.environ["NEO4J_URI"]
USERNAME = os.environ["USERNAME"] USERNAME = os.environ["NEO4J_USERNAME"]
PASSWORD = os.environ["PASSWORD"] PASSWORD = os.environ["NEO4J_PASSWORD"]
else: else:
raise Exception (f"One or more Neo4J Credentials, {credetial_parts}, not found in the environment") raise Exception (f"One or more Neo4J Credentials, {credetial_parts}, not found in the environment")
print (f"uri: {URI}")
print (f"uri: {USERNAME}")
print (f"uri: {PASSWORD}")
self._driver = GraphDatabase.driver(URI, auth=(USERNAME, PASSWORD)) self._driver = GraphDatabase.driver(URI, auth=(USERNAME, PASSWORD))
self._node_embed_algorithms = { self._node_embed_algorithms = {