Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaSBrown committed Apr 10, 2024
1 parent 6c66b28 commit b536f1e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
15 changes: 9 additions & 6 deletions scripts/globus/create_guest_collection.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import globus_sdk
from globus_sdk import scopes

import utils
import os

Expand Down Expand Up @@ -60,13 +62,14 @@

client = globus_sdk.ConfidentialAppAuthClient(client_id, client_secret)

scopes = "openid profile email urn:globus:auth:scope:auth.globus.org:manage_projects urn:globus:auth:scope:auth.globus.org:view_identities"
scopes = ("openid profile email "
"urn:globus:auth:scope:auth.globus.org:manage_projects "
"urn:globus:auth:scope:auth.globus.org:view_identities")

authorizer = globus_sdk.ClientCredentialsAuthorizer(client, scopes)

gcs_client = globus_sdk.GCSClient(DATAFED_GCS_URL, authorizer=authorizer)

from globus_sdk import scopes

# The scope the client will need, note that primary scope is for the endpoint,
# but it has a dependency on the mapped collection's data_access scope

Expand Down Expand Up @@ -112,7 +115,7 @@
mapped_collection_id = item["id"]
break

if mapped_collection_found == False:
if mapped_collection_found is False:
raise Exception("Missing required mapped collection")

storage_gateway_found = False
Expand All @@ -138,7 +141,7 @@
storage_gateway_id = item["id"]
break

if storage_gateway_found == False:
if storage_gateway_found is False:
raise Exception("Missing required storage gateway")


Expand All @@ -157,7 +160,7 @@
break

# https://github.com/globus/globus-sdk-python/blob/main/docs/examples/guest_collection_creation.rst
if guest_collection_found == False:
if guest_collection_found is False:
credential_document = globus_sdk.UserCredentialDocument(
storage_gateway_id=storage_gateway_id,
identity_id=client_id,
Expand Down
3 changes: 2 additions & 1 deletion scripts/globus/globus_cleanup.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@

ac_rt.update_project(project_id, admin_ids=[identity_id, client_id])

bash_command = f'GCS_CLI_CLIENT_ID="{client_id}" GCS_CLI_CLIENT_SECRET="{client_secret}" '
bash_command = f'GCS_CLI_CLIENT_ID="{client_id}" '
bash_command = f'GCS_CLI_CLIENT_SECRET="{client_secret}" '
bash_command += "globus-connect-server endpoint cleanup "
bash_command += f' --deployment-key "{DEPLOYMENT_KEY_PATH}" '
bash_command += " --agree-to-delete-endpoint"
Expand Down
2 changes: 1 addition & 1 deletion scripts/globus/initialize_globus_endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
organization = userinfo["identity_provider_display_name"]

# Need to determine the project uuid
if utils.projectExists(ac_rt, PROJECT_NAME) == False:
if utils.projectExists(ac_rt, PROJECT_NAME) is False:
project_id = utils.createProject(ac_rt, PROJECT_NAME, userinfo)
else:
project_id = utils.getProjectId(ac_rt, PROJECT_NAME, userinfo)
Expand Down

0 comments on commit b536f1e

Please sign in to comment.