pep8 and pylint

This commit is contained in:
Scott Moser 2012-11-13 08:59:21 -05:00
parent c377b5b9ef
commit 36dacb4a5d
1 changed files with 4 additions and 4 deletions

View File

@ -28,7 +28,7 @@ import time
frequency = PER_INSTANCE
def handle(_name, cfg, _cloud, log, _args):
def handle(_name, cfg, cloud, log, _args):
finalcmds = cfg.get("finalcmd")
@ -70,15 +70,15 @@ def handle(_name, cfg, _cloud, log, _args):
def execmd(exe_args, data_in=None, output=None):
try:
proc = subprocess.Popen(exe_args, stdin=subprocess.PIPE,
stdout=output, stderr=subprocess.STDERR)
stdout=output, stderr=subprocess.STDOUT)
proc.communicate(data_in)
except Exception as e:
except Exception:
return 254
return proc.returncode()
def runfinal(shellcode, finalcmd_d, output=None):
ret = execmd(["/bin/sh",], data_in=shellcode, output=output)
ret = execmd(["/bin/sh"], data_in=shellcode, output=output)
if not (finalcmd_d and os.path.isdir(finalcmd_d)):
sys.exit(ret)