From 748e8eec7cb23f44f9c0ec2183733a747bc63edc Mon Sep 17 00:00:00 2001 From: Ryan Forsyth Date: Thu, 5 Oct 2023 17:22:50 -0700 Subject: [PATCH] Updates --- tests/base.py | 9 +++------ zstash/create.py | 1 - zstash/globus.py | 8 +++----- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/tests/base.py b/tests/base.py index 4225d671..aca24418 100644 --- a/tests/base.py +++ b/tests/base.py @@ -51,12 +51,11 @@ def run_cmd(cmd): # `cmd` must be a list if isinstance(cmd, str): cmd = cmd.split() - print(f"base.py os.listdir={os.listdir()}") - print("base.py run_cmd A") p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) - print("base.py run_cmd B") + # TODO: user input prompts don't make it through here. It just hangs. + # Is it possible to check if we already have consents granted and then not need to prompt? + # Or, we could make a flag/command line option to prompt for consents or not. output, err = p.communicate() - print("base.py run_cmd C") # When running in Python 3, the output of subprocess.Popen.communicate() # is a bytes object. We need to convert it to a string. @@ -283,9 +282,7 @@ def create( self.hpss_path, self.test_dir, ) - print("base.py create A") output, err = run_cmd(cmd) - print("base.py create B") if use_hpss: expected_present = ["Transferring file to HPSS"] else: diff --git a/zstash/create.py b/zstash/create.py index a0549cd1..e8ca0c48 100644 --- a/zstash/create.py +++ b/zstash/create.py @@ -25,7 +25,6 @@ def create(): cache: str exclude: str - logger.warning("create.py create") cache, args = setup_create() # Check config fields diff --git a/zstash/globus.py b/zstash/globus.py index 9371231d..5c590923 100644 --- a/zstash/globus.py +++ b/zstash/globus.py @@ -56,7 +56,9 @@ def globus_flow(ep=""): get_input = getattr(__builtins__, "raw_input", input) auth_code = get_input("Please enter the code you get after login here: ") + raise Exception("CCC") token_response = CLIENT.oauth2_exchange_code_for_tokens(auth_code) + raise Exception("DDD") print(token_response) @@ -70,7 +72,6 @@ def globus_activate(hpss: str): global local_endpoint global remote_endpoint - print("globus.py globus_activate") url = urlparse(hpss) if url.scheme != "globus": return @@ -117,10 +118,7 @@ def globus_activate(hpss: str): if remote_endpoint.upper() in hpss_endpoint_map.keys(): remote_endpoint = hpss_endpoint_map.get(remote_endpoint.upper()) - print(f"local_endpoint={local_endpoint}") - print(f"remote_endpoint={remote_endpoint}") - # globus_flow(local_endpoint) - # globus_flow(remote_endpoint) + globus_flow(remote_endpoint) native_client = NativeClient( client_id="6c1629cf-446c-49e7-af95-323c6412397f",