From 6214fb97540c5569b6ee04065c52525a93281738 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 17 Dec 2018 10:09:19 +0000 Subject: [PATCH] modified: startup.py --- code/scripts/main/startup.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) mode change 100644 => 100755 code/scripts/main/startup.py diff --git a/code/scripts/main/startup.py b/code/scripts/main/startup.py old mode 100644 new mode 100755 index 425027c..d824782 --- a/code/scripts/main/startup.py +++ b/code/scripts/main/startup.py @@ -29,8 +29,9 @@ if __name__ == "__main__": args = parser.parse_args() """ Read conf """ + getpathscriptdir = os.path.dirname(sys.argv[0]) localconf = configparser.ConfigParser() - localconf.read('private/conf/config') + localconf.read("{pathrun}/private/conf/config".format(pathrun=getpathscriptdir)) generalconf = { "logger": {"logs_level": localconf['logger']['logs_level'], @@ -74,7 +75,7 @@ if __name__ == "__main__": print("You MUST save your passphrase in a security place !") key_pvt = CritConf.read_private_key(localconf['system']['key_pvt'], passhash) else: - print(gen['Error']) + print(gen['value']) logger.write({"thread":threading.get_ident(), "result": "ERROR", "type": "HYPERPROXMOX", "value": "Your key is not create due to an error: {0}".format(gen['value'])}) exit(1) @@ -168,4 +169,4 @@ if __name__ == "__main__": """ Init API thread """ logger.write({"thread":threading.get_ident(), "result": "INFO", "type": "HYPERPROXMOX", "value": "Init API thread"}) api_th = ThreadAPI(1, "ThreadAPI", urls, core, generalconf, logger) - api_th.start() \ No newline at end of file + api_th.start()