Skip to content

Commit

Permalink
fix: flex-linux-setup able to use existing jans-setup to be used as s…
Browse files Browse the repository at this point in the history
…tandalone script

fix: flex-linux-setup able to use existing jans-setup to be used as standalone script
  • Loading branch information
moabu authored Feb 22, 2022
2 parents 4efb13c + 1d1e979 commit 3ce3b58
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions flex-linux-setup/flex_linux_setup/flex_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,19 @@
print("Please install Jans Config Api then execute this script.")
sys.exit()

import jans_setup
sys.path.append(jans_setup.__path__[0])

__STATIC_SETUP_DIR__ = '/opt/jans/jans-setup/'


try:
import jans_setup
sys.path.append(jans_setup.__path__[0])
except ModuleNotFoundError:
if os.path.exists(__STATIC_SETUP_DIR__):
sys.path.append(__STATIC_SETUP_DIR__)
else:
print("Unable to locate jans-setup, exiting ...")
sys.exit()

logs_dir = os.path.join(__STATIC_SETUP_DIR__, 'logs')

if not os.path.exists(logs_dir):
Expand Down

0 comments on commit 3ce3b58

Please sign in to comment.