Skip to content

Commit

Permalink
try to auth so we can gsutilc cp
Browse files Browse the repository at this point in the history
  • Loading branch information
nikellepetrillo committed Dec 13, 2024
1 parent 105c9a3 commit 22334ec
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions scripts/firecloud_api/firecloud_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,14 +284,6 @@ def gcloud_auth_list(self):
logging.error(f"Error executing 'gcloud auth list': {e.stderr}")
return None

# Corrected logging:
if auth_list:
logging.info("Authenticated accounts:")
for account in auth_list:
logging.info(f"Account: {account['account']}, Status: {account['status']}")
else:
logging.error("Failed to retrieve gcloud authentication list.")

def gsutil_copy(self, source, destination):
client = storage.Client() # Uses GOOGLE_APPLICATION_CREDENTIALS implicitly
source_bucket_name, source_blob_name = source.replace("gs://", "").split("/", 1)
Expand All @@ -306,6 +298,14 @@ def gsutil_copy(self, source, destination):

def main(self):
logging.info("Starting process based on action.")
# Check gcloud authentication list
auth_list = self.gcloud_auth_list()
if auth_list:
logging.info("Authenticated accounts:")
for account in auth_list:
logging.info(f"Account: {account['account']}, Active: {account['active']}")
else:
logging.error("Failed to retrieve gcloud authentication list.")

if self.action == "submit_job":
submission_id = self.submit_job()
Expand Down

0 comments on commit 22334ec

Please sign in to comment.