Skip to content

Commit

Permalink
Fix Neo4j connection error
Browse files Browse the repository at this point in the history
  • Loading branch information
beatro0t committed Jun 17, 2020
1 parent 8e377f1 commit 83695a9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion INSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function install(){

APT_DEPS=("nodejs" "npm" "python3-pip" "procps" "git")
PY_DEPS=("argparse" "awscli-local" "boto3" "neo4j"
"neobolt" "configparser" "git-python")
"configparser" "git-python")

# Ensure dependencies are met
for dep in ${DEPS[*]}; do
Expand Down
8 changes: 4 additions & 4 deletions lib/graph/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
import subprocess
import time

from neo4j import GraphDatabase
from neobolt import exceptions
from neo4j import GraphDatabase, exceptions


class Neo4j(object):
Expand All @@ -16,9 +15,11 @@ class Neo4j(object):

@staticmethod
def run(cypher):

driver = GraphDatabase.driver(
Neo4j.connection,
auth=(Neo4j.username, Neo4j.password))

with driver.session() as session:
results = session.run(cypher)
driver.close()
Expand All @@ -42,7 +43,6 @@ def isavailable():
Neo4j.connection,
auth=(Neo4j.username, Neo4j.password)
).session()

except exceptions.ServiceUnavailable:
return False
return True
Expand Down Expand Up @@ -147,5 +147,5 @@ def delete(db):

@staticmethod
def _run(tx, cypher):
results=tx.run(cypher)
results = tx.run(cypher)
return results

0 comments on commit 83695a9

Please sign in to comment.