Skip to content

[v7r3] Support running dirac-configure without arguments#4997

Merged
atsareg merged 2 commits into
DIRACGrid:integrationfrom
chrisburr:better-dirac-configure
Mar 17, 2021
Merged

[v7r3] Support running dirac-configure without arguments#4997
atsareg merged 2 commits into
DIRACGrid:integrationfrom
chrisburr:better-dirac-configure

Conversation

@chrisburr

@chrisburr chrisburr commented Feb 26, 2021

Copy link
Copy Markdown
Member

This PR uses prompt-toolkit (a dependency of IPython) to improve the CLI interactions. As this inherently interactive I've included videos of how it looks. If this is accepted I'll add prompt-toolkit to DIRACOS (it's already there, but I'll make it an explicit dependency).

  • 803e53b: Gets rid of the globals used by dirac-configure. I could easily rebase this commit out of this PR if desired.

  • c12c515: Use prompt-toolkit to read the certificate password instead of plain getpass. This fixes the long standing bug that pressing Control + C while typing your password breaks the prompt. (moved to [v7r2] Use prompt_toolkit for reading passwords #5004)

dirac-proxy-init-example.mov
  • 5687a7a: If dirac-configure is ran without any arguments with a Python 3 installation it will suggest setups and CS URLs using the extension_metadata. Python 2 based installations are unaffected.
dirac-configure-example.mov

BEGINRELEASENOTES

*Core
FIX: Handle SIGINT correctly when reading certificate passwords
NEW: dirac-configure can now be ran without arguments when using Python 3

ENDRELEASENOTES

@chrisburr chrisburr force-pushed the better-dirac-configure branch 3 times, most recently from 6cb1887 to 957d117 Compare February 26, 2021 11:39
@fstagni

fstagni commented Mar 1, 2021

Copy link
Copy Markdown
Contributor

We are really towards making the releasing of v7r2, and while this is a nice addition it's also a not necessary as of now. I would target v7r3 if you don't mind.

@chrisburr

Copy link
Copy Markdown
Member Author

I'd be tempted to at least target c12c515 for v7r2 as it's a tiny change and fixes a problem that affects me almost every day.

@fstagni

fstagni commented Mar 2, 2021

Copy link
Copy Markdown
Contributor

I'd be tempted to at least target c12c515 for v7r2 as it's a tiny change and fixes a problem that affects me almost every day.

That requires a release of DIRACOS and DIRACOS2

@chrisburr

chrisburr commented Mar 2, 2021

Copy link
Copy Markdown
Member Author

That requires a release of DIRACOS and DIRACOS2

It doesn't, prompt-toolkit is already there as a transitive dependency from ipython (if it wasn't the CI would be failing).

We shouldn't rely on transitive dependencies for future releases in case it's ever removed but that's only a problem for future releases.

@fstagni

fstagni commented Mar 2, 2021

Copy link
Copy Markdown
Contributor

That requires a release of DIRACOS and DIRACOS2

It doesn't, prompt-toolkit is already there as a transitive dependency from ipython (if it wasn't the CI would be failing).

We shouldn't rely on transitive dependencies for future releases in case it's ever removed but that's only a problem for future releases.

A-ha, good to know. Then go ahead.

@chrisburr chrisburr changed the title [v7r2] Better CLI handling in dirac-proxy-init and dirac-configure [v7r3] Support running dirac-configure without arguments Mar 2, 2021
@petricm

petricm commented Mar 2, 2021

Copy link
Copy Markdown

what about the <<< passwords in the CI and similar places?

@chrisburr

Copy link
Copy Markdown
Member Author

what about the <<< passwords in the CI and similar places?

Do you mean when reading from stdin? If so there is already a dedicated flag for doing that and disabling this:

Script.registerSwitch("p", "pwstdin", "Get passwd from stdin", self.setStdinPasswd)

@petricm

petricm commented Mar 2, 2021

Copy link
Copy Markdown

I mean this dirac-proxy-init <<< $CERT_PASSPHRASE

@petricm

petricm commented Mar 2, 2021

Copy link
Copy Markdown

There are several places like this around

@atsareg

atsareg commented Mar 2, 2021

Copy link
Copy Markdown
Contributor

I do not think you can redirect password from stdin. I do not think it was ever possible, never used it this way.

@chrisburr

Copy link
Copy Markdown
Member Author

I mean this dirac-proxy-init <<< $CERT_PASSPHRASE

Yes it does, albeit with a warning:

Generating proxy...
Warning: Input is not a terminal (fd=0).
^[[39;1REnter Certificate password: **********************************
Uploading proxy..
Proxy generated:

@fstagni

fstagni commented Mar 17, 2021

Copy link
Copy Markdown
Contributor

Some conflicts, please rebase.

@chrisburr chrisburr force-pushed the better-dirac-configure branch from 957d117 to 9469b25 Compare March 17, 2021 10:21
@chrisburr

Copy link
Copy Markdown
Member Author

@fstagni Done

@atsareg atsareg merged commit 37cbd80 into DIRACGrid:integration Mar 17, 2021
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