Skip to content

Commit

Permalink
Added error handling for invokerservlet authentication failure
Browse files Browse the repository at this point in the history
  • Loading branch information
breenmachine committed May 16, 2014
1 parent b266f09 commit 1effd5b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
7 changes: 3 additions & 4 deletions src/module/deploy_utils.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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


Expand Down
13 changes: 8 additions & 5 deletions src/platform/jboss/deployers/ejbinvokerservlet.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
5 changes: 4 additions & 1 deletion src/platform/jboss/deployers/jmxinvokerservlet.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 1effd5b

Please sign in to comment.