Skip to content

Commit

Permalink
JBoss - Added support for WildFly 8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
hatRiot committed Jun 5, 2014
1 parent bead215 commit 2ae5b9f
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 35 deletions.
2 changes: 1 addition & 1 deletion src/platform/jboss/authenticate.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def _auth(usr, pswd, url, version):
"""

authobj = HTTPBasicAuth
if version in ['7.0', '7.1', '8.0']:
if version in ['7.0', '7.1', '8.0', '8.1']:
authobj = HTTPDigestAuth

res = utility.requests_get(url, auth=authobj(usr, pswd))
Expand Down
2 changes: 1 addition & 1 deletion src/platform/jboss/auxiliary/info_dump.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def run(self, fingerengine, fingerprint):

utility.Msg("Attempting to retrieve JBoss info...")

if fingerprint.version in ["7.0", "7.1", "8.0"]:
if fingerprint.version in ["7.0", "7.1", "8.0", "8.1"]:
# JBoss 7.x uses an HTTP API instead of jmx-console/
return self.run7(fingerengine, fingerprint)

Expand Down
4 changes: 2 additions & 2 deletions src/platform/jboss/auxiliary/list_wars.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def check(self, fingerprint):

if fingerprint.title == JINTERFACES.JMX:
return True
elif fingerprint.version in ["7.0", "7.1", '8.0']:
elif fingerprint.version in ["7.0", "7.1", '8.0', '8.1']:
return True

return False
Expand All @@ -38,7 +38,7 @@ def run(self, fingerengine, fingerprint):
url = 'http://{0}:{1}/jmx-console/HtmlAdaptor?action='\
'displayMBeans&filter=jboss.web.deployment'.format\
(fingerengine.options.ip, fingerprint.port)
elif fingerprint.version in ["7.0", "7.1", '8.0']:
elif fingerprint.version in ["7.0", "7.1", '8.0', '8.1']:
return self.run7(fingerengine, fingerprint)
elif fingerprint.title == JINTERFACES.JMX:
url = 'http://{0}:{1}/jmx-console/'.format(fingerengine.options.ip,
Expand Down
2 changes: 1 addition & 1 deletion src/platform/jboss/deployers/http_management.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from log import LOG
import utility

versions = ["7.0", "7.1", '8.0']
versions = ["7.0", "7.1", '8.0', '8.1']
title = JINTERFACES.MM
def deploy(fingerengine, fingerprint):
""" Deploying WARs to JBoss 7.x is a three stage process. The first stage
Expand Down
16 changes: 16 additions & 0 deletions src/platform/jboss/fingerprints/JBoss81Manage.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from src.platform.jboss.interfaces import JINTERFACES
from requests import exceptions
from cprint import FingerPrint
from log import LOG
import utility


class FPrint(FingerPrint):

def __init__(self):
self.platform = "jboss"
self.version = "8.1"
self.title = JINTERFACES.MM
self.uri = "/console/app/community.css"
self.port = 9990
self.hash = "1e4a0817a2d5fd8e2eed4afddb8673b1"
32 changes: 2 additions & 30 deletions src/platform/jboss/fingerprints/JBoss8Manage.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
from src.platform.jboss.interfaces import JINTERFACES
from requests import exceptions
from cprint import FingerPrint
from log import LOG
import utility


class FPrint(FingerPrint):
Expand All @@ -11,31 +8,6 @@ def __init__(self):
self.platform = "jboss"
self.version = "8.0"
self.title = JINTERFACES.MM
self.uri = "/error/index_win.html"
self.uri = "/console/app/community.css"
self.port = 9990
self.hash = None

def check(self, ip, port = None):
""" This works for current releases of JBoss 8.0; future
versions may require us to modify this.
"""

try:
rport = self.port if port is None else port
request = utility.requests_get("http://{0}:{1}{2}".format(
ip, rport, self.uri))

if request.status_code == 200:
if "WildFly 8" in request.content:
return True

except exceptions.Timeout:
utility.Msg("{0} timeout to {1}:{2}".format(self.platform,
ip, rport),
LOG.DEBUG)
except exceptions.ConnectionError:
utility.Msg("{0} connection error to {1}:{2}".format(self.platform,
ip, rport),
LOG.DEBUG)

return False
self.hash = "8cc75d302cebed555dea0290b86cc9cc"

0 comments on commit 2ae5b9f

Please sign in to comment.