Merge "Add a ssh key file checking"
This commit is contained in:
commit
ebc4e8a57c
@ -76,9 +76,10 @@ DEFAULT_PARAMS = {
|
||||
'restore_abs_path': None, 'log_file': None, 'log_level': "info",
|
||||
'mode': 'fs', 'action': 'backup', 'shadow': '', 'shadow_path': '',
|
||||
'windows_volume': '', 'command': None, 'metadata_out': None,
|
||||
'storage': 'swift', 'ssh_key': '', 'ssh_username': '', 'ssh_host': '',
|
||||
'ssh_port': DEFAULT_SSH_PORT, 'access_key': '', 'secret_key': '',
|
||||
'endpoint': '', 'compression': 'gzip', 'overwrite': False,
|
||||
'storage': 'swift', 'ssh_key': os.path.join(home, '.ssh/id_rsa'),
|
||||
'ssh_username': '', 'ssh_host': '', 'ssh_port': DEFAULT_SSH_PORT,
|
||||
'access_key': '', 'secret_key': '', 'endpoint': '',
|
||||
'compression': 'gzip', 'overwrite': False,
|
||||
'incremental': None, 'consistency_check': False,
|
||||
'consistency_checksum': None, 'nova_restore_network': None,
|
||||
'cindernative_backup_id': None, 'sync': True, 'engine_name': 'tar',
|
||||
|
@ -64,6 +64,12 @@ class SshStorage(fslike.FsLikeStorage):
|
||||
elif not self.ssh_key_path:
|
||||
raise ValueError('Please provide path to ssh key using '
|
||||
'--ssh-key argument.')
|
||||
elif not os.path.exists(self.ssh_key_path):
|
||||
raise ValueError('The {0} is required, please ensure it '
|
||||
'exists and ensure backup node can login '
|
||||
'to {1} as user {2} without password '
|
||||
.format(self.ssh_key_path, self.remote_ip,
|
||||
self.remote_username))
|
||||
return True
|
||||
|
||||
def init(self):
|
||||
|
Loading…
x
Reference in New Issue
Block a user