Skip to content

Commit

Permalink
Replaced a few splits with parse_war_path
Browse files Browse the repository at this point in the history
* src/platform/jboss/deployers/http_management.py
  src/platform/jboss/deployers/jmx_deploy.py
  src/platform/jboss/deployers/webconsole_deploy.py
  src/module/deploy_utils.py
  -- When parsing a given WAR file from an abspath, I wrote
  a small helper function, parse_war_path.  Replaced a few
  missed instances of this in the code.

* src/module/invoke_payload.py
  -- Committed a check for a raw URL to invoke.  Temporary
  while this portion is reworked.
  • Loading branch information
hatRiot committed May 6, 2015
1 parent b26bfa1 commit 8930ee9
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/module/deploy_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def _serve(war_file = None):
kill(proc.pid, SIGINT)

if war_file:
war_name = war_file.rsplit('/', 1)[1]
war_name = parse_war_path(war_file, True)
# remove our copied file
remove("%s/%s" % (state.serve_dir, war_name))

Expand Down
3 changes: 3 additions & 0 deletions src/module/invoke_payload.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ def invoke(fingerengine, fingerprint, deployer):
"""
"""

if fingerengine.invoke_url:
return _invoke(fingerengine.invoke_url)

if fingerengine.service in ["jboss", "tomcat", "weblogic", "glassfish"]:
if fingerengine.service == 'glassfish' or\
(fingerengine.service == 'jboss' and\
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 @@ -18,7 +18,7 @@ def deploy(fingerengine, fingerprint):

war_file = abspath(fingerengine.options.deploy)
war_name = parse_war_path(war_file)
war_raw = war_file.rsplit('/', 1)[1]
war_raw = parse_war_path(war_file, True)
utility.Msg("Preparing to deploy {0}...".format(war_file))

base = "http://{0}:{1}/management".format(fingerengine.options.ip,
Expand Down
4 changes: 2 additions & 2 deletions src/platform/jboss/deployers/jmx_deploy.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from src.platform.jboss.interfaces import JINTERFACES
from src.platform.jboss.authenticate import checkAuth
from src.module.deploy_utils import _serve, waitServe, killServe
from src.module.deploy_utils import _serve, waitServe, killServe, parse_war_path
from collections import OrderedDict
from threading import Thread
from requests import get, exceptions
Expand All @@ -18,7 +18,7 @@ def deploy(fingerengine, fingerprint):
"""

war_file = abspath(fingerengine.options.deploy)
war_name = war_file.rsplit('/', 1)[1]
war_name = parse_war_path(war_file, True)

# start up the local HTTP server
server_thread = Thread(target=_serve, args=(war_file,))
Expand Down
4 changes: 2 additions & 2 deletions src/platform/jboss/deployers/webconsole_deploy.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from src.platform.jboss.interfaces import JINTERFACES
from src.module.deploy_utils import _serve, wc_invoke, waitServe,killServe
from src.module.deploy_utils import _serve, wc_invoke, waitServe,killServe, parse_war_path
from requests import get
from threading import Thread
from time import sleep
Expand All @@ -15,7 +15,7 @@ def deploy(fingerengine, fingerprint):
"""

war_file = abspath(fingerengine.options.deploy)
war_name = war_file.rsplit('/', 1)[1]
war_name = parse_war_path(war_file, True)

# start the local HTTP server
server_thread = Thread(target=_serve, args=(war_file,))
Expand Down

0 comments on commit 8930ee9

Please sign in to comment.