storage manager: refactor base_dir option.
Fix it so the `base_dir` option is only required by subclasses that actually use it. The StorageManager::Mirror class doesn't use it.
This commit is contained in:
@@ -10,10 +10,11 @@ class StorageManager::SFTP < StorageManager
|
||||
non_interactive: true
|
||||
}
|
||||
|
||||
attr_reader :hosts, :ssh_options
|
||||
attr_reader :hosts, :ssh_options, :base_dir
|
||||
|
||||
def initialize(*hosts, ssh_options: {}, **options)
|
||||
def initialize(*hosts, base_dir: nil, ssh_options: {}, **options)
|
||||
@hosts = hosts
|
||||
@base_dir = base_dir.to_s
|
||||
@ssh_options = DEFAULT_SSH_OPTIONS.merge(ssh_options)
|
||||
super(**options)
|
||||
end
|
||||
@@ -73,4 +74,8 @@ class StorageManager::SFTP < StorageManager
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def full_path(path)
|
||||
File.join(base_dir, path)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user