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:
Colton Myers 2013-09-26 12:39:40 -07:00
commit 5140c33d7e
2 changed files with 7 additions and 5 deletions

View File

@ -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

View File

@ -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