diff util/subtools.py @ 2:8ff4b84d709f draft

planemo upload for repository https://github.com/Yating-L/jbrowsehub-to-apollo.git commit 324276a31f1d9e410c37d4514ad9432ba6051e35-dirty
author yating-l
date Wed, 25 Oct 2017 12:41:34 -0400
parents 2ae1e96a8380
children
line wrap: on
line diff
--- a/util/subtools.py	Tue Oct 24 18:24:40 2017 -0400
+++ b/util/subtools.py	Wed Oct 25 12:41:34 2017 -0400
@@ -63,7 +63,6 @@
         # If we detect an error from the subprocess, then we raise an exception
         # TODO: Manage if we raise an exception for everything, or use CRITICAL etc... but not stop process
         # TODO: The responsability of returning a sys.exit() should not be there, but up in the app.
-        #if p.returncode:
         if p.returncode:
             if stderr == subprocess.PIPE:
                 raise PopenError(cmd, error, p.returncode)
@@ -143,14 +142,14 @@
             return d['userId']
     logging.error("Cannot find user %s", user_email)
 
-def verify_user_login(username, password):
+def verify_user_login(username, password, apollo_host):
     user_info = {'username': username, 'password': password}
     array_call = ['curl', 
                   '-b', 'cookies.txt', 
                   '-c', 'cookies.txt', 
                   '-H', 'Content-Type:application/json',
                   '-d', json.dumps(user_info),
-                  'http://localhost:8080/apollo/Login?operation=login'
+                  apollo_host + '/Login?operation=login'
                   ]
     p = _handleExceptionAndCheckCall(array_call)
     msg = json.loads(p)