mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 17:33:54 +00:00
Merge pull request #7467 from ranl/tomcat6_support
using cp.get_url instead of cp.get_file int tomcat module
This commit is contained in:
commit
5140c33d7e
@ -453,7 +453,7 @@ def deploy_war(war,
|
||||
url : http://localhost:8080/manager
|
||||
the URL of the server manager webapp
|
||||
env : base
|
||||
the environment for WAR file in used by salt.modules.cp.get_file
|
||||
the environment for WAR file in used by salt.modules.cp.get_url
|
||||
function
|
||||
timeout : 180
|
||||
timeout for HTTP request
|
||||
@ -477,10 +477,12 @@ def deploy_war(war,
|
||||
|
||||
# Copy file name if needed
|
||||
tfile = war
|
||||
if war[0] != '/':
|
||||
cache = False
|
||||
if not os.path.isfile(war):
|
||||
cache = True
|
||||
tfile = os.path.join(tempfile.gettempdir(), 'salt.' +
|
||||
os.path.basename(war))
|
||||
cached = __salt__['cp.get_file'](war, tfile, env)
|
||||
cached = __salt__['cp.get_url'](war, tfile, env)
|
||||
if not cached:
|
||||
return 'FAIL - could not cache the WAR file'
|
||||
try:
|
||||
@ -502,7 +504,7 @@ def deploy_war(war,
|
||||
res = '\n'.join(deployed['msg'])
|
||||
|
||||
# Cleanup
|
||||
if war[0] != '/':
|
||||
if cache:
|
||||
__salt__['file.remove'](tfile)
|
||||
|
||||
return res
|
||||
|
@ -64,7 +64,7 @@ def war_deployed(name, war, url='http://localhost:8080/manager',
|
||||
the context path to deploy
|
||||
war
|
||||
absolute path to WAR file (should be accessible by the user running
|
||||
tomcat) or a path supported by the salt.modules.cp.get_file function
|
||||
tomcat) or a path supported by the salt.modules.cp.get_url function
|
||||
url : http://localhost:8080/manager
|
||||
the URL of the server manager webapp
|
||||
timeout : 180
|
||||
|
Loading…
Reference in New Issue
Block a user