Skip to content

Commit

Permalink
Remove host parameter as obligatory in SFTPStorage (jschneier#926)
Browse files Browse the repository at this point in the history
* Remove host parameter as obligatory in SFTPStorage

This allows the SFTP_STORAGE_HOST setting to actually be used.

* Fix tests: make hostname a keyword argument

* Fix typo: hostname -> host

Co-authored-by: Lode Rosseel <[email protected]>
  • Loading branch information
2 people authored and mlazowik committed Mar 9, 2022
1 parent 992e924 commit 615ad22
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions storages/backends/sftpstorage.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@

@deconstructible
class SFTPStorage(BaseStorage):
def __init__(self, host=None, **settings):
super().__init__(host=host, **settings)
def __init__(self, **settings):
super().__init__(**settings)
self._host = self.host
self._params = self.params
self._interactive = self.interactive
Expand Down
4 changes: 2 additions & 2 deletions tests/test_sftp.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

class SFTPStorageTest(TestCase):
def setUp(self):
self.storage = sftpstorage.SFTPStorage('foo')
self.storage = sftpstorage.SFTPStorage(host='foo')

def test_init(self):
pass
Expand Down Expand Up @@ -178,7 +178,7 @@ def test_override_init_argument(self):

class SFTPStorageFileTest(TestCase):
def setUp(self):
self.storage = sftpstorage.SFTPStorage('foo')
self.storage = sftpstorage.SFTPStorage(host='foo')
self.file = sftpstorage.SFTPStorageFile('bar', self.storage, 'wb')

@patch('storages.backends.sftpstorage.SFTPStorage.sftp', **{
Expand Down

0 comments on commit 615ad22

Please sign in to comment.