mirror of https://github.com/n1nj4sec/pupy.git
fix agents without debug enabled
This commit is contained in:
parent
8dbb447f72
commit
43a3b015d4
|
@ -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
|
||||
|
|
|
@ -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))
|
||||
|
||||
|
|
Loading…
Reference in New Issue