diff --git a/src/module/deploy_utils.py b/src/module/deploy_utils.py index b335e3b..6c27182 100644 --- a/src/module/deploy_utils.py +++ b/src/module/deploy_utils.py @@ -1,6 +1,6 @@ from src.platform.weblogic.interfaces import WINTERFACES from time import sleep -from subprocess import Popen, PIPE, check_output +from subprocess import Popen, PIPE, check_output,STDOUT from requests import get from signal import SIGINT from os import kill, system @@ -104,15 +104,14 @@ def invkdeploy(version, url, local_url, random_int): if creds != None: res = check_output(["./invkdeploy.sh", version, url, local_url, str(random_int),creds[0],creds[1]], - cwd="./src/lib/jboss/jmxinvoke_deploy") + cwd="./src/lib/jboss/jmxinvoke_deploy",stderr=STDOUT) else: res = check_output(["./invkdeploy.sh", version, url, local_url, str(random_int)], - cwd="./src/lib/jboss/jmxinvoke_deploy") + cwd="./src/lib/jboss/jmxinvoke_deploy",stderr=STDOUT) except Exception, e: utility.Msg(e, LOG.DEBUG) res = str(e) - return res diff --git a/src/platform/jboss/deployers/ejbinvokerservlet.py b/src/platform/jboss/deployers/ejbinvokerservlet.py index 8d6f573..e5f79b1 100644 --- a/src/platform/jboss/deployers/ejbinvokerservlet.py +++ b/src/platform/jboss/deployers/ejbinvokerservlet.py @@ -53,9 +53,12 @@ def deploy(fingerengine, fingerprint): fingerengine.random_int) if len(response) > 1: - utility.Msg(response, LOG.DEBUG) + if('org.jboss.web.tomcat.security.SecurityAssociationValve' in response and 'org.apache.catalina.authenticator.AuthenticatorBase.invoke' in response): + utility.Msg('Deployment failed due to insufficient or invalid credentials.', LOG.ERROR) + else: + utility.Msg(response, LOG.DEBUG) else: - utility.Msg("{0} deployed to {1} (/{2})".format(war_file, - fingerengine.options.ip, - war_name + fingerengine.random_int), - LOG.SUCCESS) + utility.Msg("{0} deployed to {1} (/{2})".format(war_name, + fingerengine.options.ip, + war_name + fingerengine.random_int), + LOG.SUCCESS) diff --git a/src/platform/jboss/deployers/jmxinvokerservlet.py b/src/platform/jboss/deployers/jmxinvokerservlet.py index 432e5de..137f6fe 100644 --- a/src/platform/jboss/deployers/jmxinvokerservlet.py +++ b/src/platform/jboss/deployers/jmxinvokerservlet.py @@ -54,7 +54,10 @@ def deploy(fingerengine, fingerprint): fingerengine.random_int) if len(response) > 1: - utility.Msg(response, LOG.DEBUG) + if('org.jboss.web.tomcat.security.SecurityAssociationValve' in response and 'org.apache.catalina.authenticator.AuthenticatorBase.invoke' in response): + utility.Msg('Deployment failed due to insufficient or invalid credentials.', LOG.ERROR) + else: + utility.Msg(response, LOG.DEBUG) else: utility.Msg("{0} deployed to {1} (/{2})".format(war_name, fingerengine.options.ip,