Skip to content

Conversation

@SergioLangaritaBenitez
Copy link
Collaborator

No description provided.

try:
with open(svc["script"]) as s:
fdl_directory = os.path.dirname(fdl_path)
script_path = fdl_directory + "/" + svc["script"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sure that if the user specifies an absolute path for the shell script in the FDL this is respected. If it is a relative path, then you join fdl_directory with the relative path.


@staticmethod
def refresh_access_token(refresh_token, scopes, token_endpoint):
def refresh_access_token(refresh_token, scopes, token_endpoint, client_id):
Copy link
Member

@esparig esparig Oct 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please consider whether adding client_id as a new parameter could cause a backward compatibility issue. If we want it to continue working as before, we could add a default value.

else:
fdl_directory = os.path.dirname(fdl_path)
script_path = fdl_directory + "/" + svc["script"]
print(script_path)
Copy link
Member

@esparig esparig Oct 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this print necessary? Was it left over from a debugging process? I suggest removing it or using an appropriate logging method.

script_path = svc["script"]
else:
fdl_directory = os.path.dirname(fdl_path)
script_path = fdl_directory + "/" + svc["script"]
Copy link
Member

@esparig esparig Oct 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's better to use os.path.join(fdl_directory, svc['script']). Using simple concatenation with + can cause issues with double slashes //.

with open(script_path) as s:
svc["script"] = s.read()
except IOError:
raise Exception("Couldn't read script")
Copy link
Member

@esparig esparig Oct 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's better to preserve the original exception message to improve debugging.

try:
  #whatever
except IOError as e:
  raise Exception("Couldn't read script") from e

@SergioLangaritaBenitez SergioLangaritaBenitez merged commit da0cf91 into main Oct 10, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants