mirror of
https://github.com/gryf/boxpy.git
synced 2025-12-19 05:30:18 +01:00
Add possibility to just pass key name.
From now, it's possible to just pass the key name, not the full path to the key. By default it will be looked for in ~/.ssh directory.
This commit is contained in:
3
box.py
3
box.py
@@ -83,6 +83,9 @@ class VMCreate:
|
||||
|
||||
if not self.ssh_key_path.endswith('.pub'):
|
||||
self.ssh_key_path += '.pub'
|
||||
if not os.path.exists(self.ssh_key_path):
|
||||
self.ssh_key_path = os.path.join(os.path.expanduser("~/.ssh"),
|
||||
self.ssh_key_path)
|
||||
if not os.path.exists(self.ssh_key_path):
|
||||
raise BoxNotFound(f'Cannot find default ssh public key: '
|
||||
f'{self.ssh_key_path}')
|
||||
|
||||
Reference in New Issue
Block a user