mirror of https://github.com/n1nj4sec/pupy.git
fix agents without debug enabled
This commit is contained in:
parent
8dbb447f72
commit
43a3b015d4
|
@ -881,6 +881,8 @@ def init_pupy(argv, stdlib, debug=False):
|
||||||
set_debug(debug)
|
set_debug(debug)
|
||||||
|
|
||||||
|
|
||||||
|
LOGGER = get_logger('pupy')
|
||||||
|
|
||||||
dprint(
|
dprint(
|
||||||
'init_pupy: argv={} sys.argv={}',
|
'init_pupy: argv={} sys.argv={}',
|
||||||
repr(argv), repr(sys.argv)
|
repr(argv), repr(sys.argv)
|
||||||
|
@ -898,7 +900,6 @@ def init_pupy(argv, stdlib, debug=False):
|
||||||
|
|
||||||
if debug:
|
if debug:
|
||||||
from .logger import enable_debug_logger
|
from .logger import enable_debug_logger
|
||||||
LOGGER = get_logger('pupy')
|
|
||||||
__debug_file = enable_debug_logger(LOGGER)
|
__debug_file = enable_debug_logger(LOGGER)
|
||||||
|
|
||||||
for pending in __debug_pending:
|
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):
|
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)
|
prepare(argv, debug, config, stdlib)
|
||||||
|
|
||||||
from .service import run
|
from .service import run
|
||||||
|
|
|
@ -109,6 +109,7 @@ class PupyConfig(RawConfigParser):
|
||||||
self.user_path = path.join(self.user_root, config)
|
self.user_path = path.join(self.user_root, config)
|
||||||
|
|
||||||
if not os.path.exists(self.user_path):
|
if not os.path.exists(self.user_path):
|
||||||
|
os.makedirs(self.user_root)
|
||||||
shutil.copyfile(self.default_file, self.user_path)
|
shutil.copyfile(self.default_file, self.user_path)
|
||||||
logger.info("No default pupy config file, creating one in {}".format(self.user_path))
|
logger.info("No default pupy config file, creating one in {}".format(self.user_path))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue