[ARVADOS] updated: 20135b59855216b0ccd8154795e359c4bd11d456

git at public.curoverse.com git at public.curoverse.com
Tue Oct 13 15:47:58 EDT 2015


Summary of changes:
 sdk/go/arvadostest/run_servers.go   | 10 +++++-----
 sdk/python/tests/run_test_server.py | 14 +++++---------
 2 files changed, 10 insertions(+), 14 deletions(-)

       via  20135b59855216b0ccd8154795e359c4bd11d456 (commit)
      from  70c7c9f19692ea7275541006e720c3ea56ba32e1 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 20135b59855216b0ccd8154795e359c4bd11d456
Author: radhika <radhika at curoverse.com>
Date:   Tue Oct 13 15:46:26 2015 -0400

    7167: update run_test_servers.py to use action="store_true" instead of converting string to boolean.

diff --git a/sdk/go/arvadostest/run_servers.go b/sdk/go/arvadostest/run_servers.go
index ed75b4b..0b60709 100644
--- a/sdk/go/arvadostest/run_servers.go
+++ b/sdk/go/arvadostest/run_servers.go
@@ -111,15 +111,15 @@ func StartKeepWithParams(keepExisting bool, enforcePermissions bool) {
 	defer os.Chdir(cwd)
 	chdirToPythonTests()
 
-	keepExistingStr := ""
+	cmdArgs := []string{"run_test_server.py", "start_keep"}
 	if keepExisting {
-		keepExistingStr = "true"
+		cmdArgs = append(cmdArgs, "--keep-existing")
 	}
-	enforcePermissionsStr := ""
 	if enforcePermissions {
-		enforcePermissionsStr = "true"
+		cmdArgs = append(cmdArgs, "--keep-enforce-permissions")
 	}
-	cmd := exec.Command("python", "run_test_server.py", "start_keep", "--keep-existing", keepExistingStr, "--keep-enforce-permissions", enforcePermissionsStr)
+
+	cmd := exec.Command("python", cmdArgs...)
 
 	stderr, err := cmd.StderrPipe()
 	if err != nil {
diff --git a/sdk/python/tests/run_test_server.py b/sdk/python/tests/run_test_server.py
index a7b60e7..100e2ef 100644
--- a/sdk/python/tests/run_test_server.py
+++ b/sdk/python/tests/run_test_server.py
@@ -44,7 +44,6 @@ if not os.path.exists(TEST_TMPDIR):
 my_api_host = None
 _cached_config = {}
 keep_existing = False
-enforce_permissions = False
 
 def find_server_pid(PID_PATH, wait=10):
     now = time.time()
@@ -325,7 +324,7 @@ def _start_keep(n, keep_args):
 
     return port
 
-def run_keep(blob_signing_key=None):
+def run_keep(blob_signing_key=None, enforce_permissions=False):
     if not keep_existing:
       stop_keep()
 
@@ -606,15 +605,12 @@ if __name__ == "__main__":
     parser = argparse.ArgumentParser()
     parser.add_argument('action', type=str, help="one of {}".format(actions))
     parser.add_argument('--auth', type=str, metavar='FIXTURE_NAME', help='Print authorization info for given api_client_authorizations fixture')
-    parser.add_argument('--keep-existing', type=str, help="Used to add additional keep servers, without terminating existing servers")
-    parser.add_argument('--keep-enforce-permissions', type=str, help="Enforce keep permissions")
+    parser.add_argument('--keep-existing', action="store_true", help="Used to add additional keep servers, without terminating existing servers")
+    parser.add_argument('--keep-enforce-permissions', action="store_true", help="Enforce keep permissions")
 
     args = parser.parse_args()
 
-    if args.keep_existing == 'true':
-        keep_existing = True
-    if args.keep_enforce_permissions == 'true':
-        enforce_permissions = True
+    keep_existing = args.keep_existing
 
     if args.action not in actions:
         print("Unrecognized action '{}'. Actions are: {}.".format(args.action, actions), file=sys.stderr)
@@ -633,7 +629,7 @@ if __name__ == "__main__":
     elif args.action == 'stop':
         stop(force=('ARVADOS_TEST_API_HOST' not in os.environ))
     elif args.action == 'start_keep':
-        run_keep()
+        run_keep(enforce_permissions=args.keep_enforce_permissions)
     elif args.action == 'stop_keep':
         stop_keep()
     elif args.action == 'start_keep_proxy':

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list