Skip to content

Exception when config not available #21

@thomai

Description

@thomai

Catch exception if one of the config files is not available.


SSHKeyDistribut0r
=================
Welcome to the world of key distribution!

Traceback (most recent call last):
  File "/usr/bin/SSHKeyDistribut0r", line 11, in <module>
    load_entry_point('SSHKeyDistribut0r==0.2.3', 'console_scripts', 'SSHKeyDistribut0r')()
  File "/home/user/local/lib/python3.9/site-packages/SSHKeyDistribut0r/command_line.py", line 32, in main
    SSHKeyDistribut0r.main(args)
  File "/home/user/.local/lib/python3.9/site-packages/SSHKeyDistribut0r/key_distribut0r.py", line 68, in main
    servers = read_config(args.server)
  File "/home/user/.local/lib/python3.9/site-packages/SSHKeyDistribut0r/key_distribut0r.py", line 54, in read_config
    return yaml.load(open(config_file))
FileNotFoundError: [Errno 2] No such file or directory: '/home/user/.config/SSHKeyDistribut0r/servers.yml'```

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions