Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --output option to pbench-generate-token #3264

Merged

Conversation

portante
Copy link
Member

This option makes it a bit easier to script the invocation of pbench-generate-token where username and/or password prompts are required (the prompt does not get mixed up into the token output).


Separated into its own PR from PR #3259.

This option makes it a bit easier to script the invocation of
`pbench-generate-token` where username and/or password prompts are
required (the prompt does not get mixed up into the token output).
Copy link
Member

@webbnh webbnh left a comment

Choose a reason for hiding this comment

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

As long as you're adding the ability to write the token to a file, here, you should consider endowing results-move and results-push to read it from there.

Comment on lines +44 to +45
with open(self.context.output, "w") as ofp:
ofp.write(f"{payload['auth_token']}\n")
Copy link
Member

Choose a reason for hiding this comment

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

Alternately,

                Path(self.context.output).write_text(payload['auth_token'] + '\n')

(Since you used Path.read_text() in the test....)

@portante portante merged commit e496ad7 into distributed-system-analysis:main Feb 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants