fix agents without debug enabled

This commit is contained in:
n1nj4sec 2022-11-05 14:27:41 +01:00
parent 8dbb447f72
commit 43a3b015d4
2 changed files with 3 additions and 3 deletions

View File

@ -880,6 +880,8 @@ def init_pupy(argv, stdlib, debug=False):
set_stdio(null=not debug)
set_debug(debug)
LOGGER = get_logger('pupy')
dprint(
'init_pupy: argv={} sys.argv={}',
@ -898,7 +900,6 @@ def init_pupy(argv, stdlib, debug=False):
if debug:
from .logger import enable_debug_logger
LOGGER = get_logger('pupy')
__debug_file = enable_debug_logger(LOGGER)
for pending in __debug_pending:
@ -1011,8 +1012,6 @@ def prepare(argv=sys.argv, debug=False, config={}, stdlib=None):
def main(argv=sys.argv, debug=False, config={}, stdlib=None):
#import builtins
#builtins.open(2, 'w').write("here from python\n")
prepare(argv, debug, config, stdlib)
from .service import run

View File

@ -109,6 +109,7 @@ class PupyConfig(RawConfigParser):
self.user_path = path.join(self.user_root, config)
if not os.path.exists(self.user_path):
os.makedirs(self.user_root)
shutil.copyfile(self.default_file, self.user_path)
logger.info("No default pupy config file, creating one in {}".format(self.user_path))