mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
cp.get_url: add note and test for https:// URL with `dest=None
`
This commit is contained in:
parent
ff55f77179
commit
c7cf79e959
2 changed files with 23 additions and 1 deletions
|
@ -322,7 +322,13 @@ def get_url(path, dest='', saltenv='base', env=None):
|
|||
destination path. If this parameter is omitted or set as empty string
|
||||
(``''``), the function places the file on the local filesystem inside
|
||||
the Minion cache directory and will return the path to that file.
|
||||
To simply return the file contents instead, set destination to ``None``.
|
||||
|
||||
.. note::
|
||||
|
||||
To simply return the file contents instead, set destination to
|
||||
``None``. This works with ``salt://``, ``http://`` and ``https://``
|
||||
URLs. The files fetched by ``http://`` and ``https://`` will not be
|
||||
cached.
|
||||
|
||||
saltenv : base
|
||||
Salt fileserver envrionment from which to retrieve the file. Ignored if
|
||||
|
|
|
@ -220,6 +220,22 @@ class CPModuleTest(integration.ModuleCase):
|
|||
self.assertIn('Windows', data)
|
||||
self.assertNotIn('AYBABTU', data)
|
||||
|
||||
def test_get_url_https_no_dest(self):
|
||||
'''
|
||||
cp.get_url with https:// source given and destination set as None
|
||||
'''
|
||||
tgt = None
|
||||
ret = self.run_function(
|
||||
'cp.get_url',
|
||||
[
|
||||
'https://repo.saltstack.com/index.html',
|
||||
tgt,
|
||||
])
|
||||
self.assertIn('Bootstrap', ret)
|
||||
self.assertIn('Debian', ret)
|
||||
self.assertIn('Windows', ret)
|
||||
self.assertNotIn('AYBABTU', ret)
|
||||
|
||||
def test_cache_file(self):
|
||||
'''
|
||||
cp.cache_file
|
||||
|
|
Loading…
Add table
Reference in a new issue