Skip to content

Commit

Permalink
move imports back to conditional and add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Marshall-Hallenbeck committed Oct 18, 2023
1 parent ffeb206 commit f87eeff
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions nxc/helpers/bloodhound.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
#!/usr/bin/env python3

from neo4j import GraphDatabase
from neo4j.exceptions import AuthError, ServiceUnavailable


def add_user_bh(user, domain, logger, config):
"""Adds a user to the BloodHound graph database.
Expand Down Expand Up @@ -31,6 +28,10 @@ def add_user_bh(user, domain, logger, config):
users_owned = user

if config.get("BloodHound", "bh_enabled") != "False":
# we do a conditional import here to avoid loading these if BH isn't enabled
from neo4j import GraphDatabase
from neo4j.exceptions import AuthError, ServiceUnavailable

uri = f"bolt://{config.get('BloodHound', 'bh_uri')}:{config.get('BloodHound', 'bh_port')}"

driver = GraphDatabase.driver(
Expand Down

0 comments on commit f87eeff

Please sign in to comment.