`ch-image` barfs if `CH_IMAGE_USERNAME` not set and no stdin
## Summary Version: 0.44 / main \ Environment: n/a ## Steps to reproduce ``` $ unset CH_IMAGE_USERNAME $ unset CH_IMAGE_PASSWORD $ ch-image --auth --tls-no-verify pull foo bar < /dev/null ``` ## Expected behavior Good error message about not being able to get username and password to authenticate with the registry. ## Actual behavior Traceback: ``` Username: Traceback (most recent call last): File "/home/reidpr/charliecloud/bin/../lib/registry.py", line 298, in get username = os.environ["CH_IMAGE_USERNAME"] ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^ File "<frozen os>", line 717, in __getitem__ KeyError: 'CH_IMAGE_USERNAME' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/reidpr/charliecloud/bin/ch-image", line 148, in <module> main() ~~~~^^ [...] File "/home/reidpr/charliecloud/bin/../lib/registry.py", line 219, in token_auth (username, password) = creds.get() ~~~~~~~~~^^ File "/home/reidpr/charliecloud/bin/../lib/registry.py", line 304, in get username = input("\nUsername: ") EOFError: EOF when reading a line ``` ## Comments I think we just need to handle `EOFError` from `input()`, i.e. there aren’t additional conditions to worry about.
issue