mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-23 05:10:22 -07:00
now get_url defaults to module temp dir (#36218)
* now get_url and other modules default to module temp dir also fixed 'bare' exception * allow modules to work with older versions * updated docs per feedback
This commit is contained in:
parent
0bbea9a579
commit
c119d54e4a
7 changed files with 15 additions and 14 deletions
|
@ -316,7 +316,7 @@ def ensure_yum_utils(module):
|
|||
def fetch_rpm_from_url(spec, module=None):
|
||||
# download package so that we can query it
|
||||
package_name, _ = os.path.splitext(str(spec.rsplit('/', 1)[1]))
|
||||
package_file = tempfile.NamedTemporaryFile(prefix=package_name, suffix='.rpm', delete=False)
|
||||
package_file = tempfile.NamedTemporaryFile(dir=getattr(module, 'tmpdir', None), prefix=package_name, suffix='.rpm', delete=False)
|
||||
module.add_cleanup_file(package_file.name)
|
||||
try:
|
||||
rsp, info = fetch_url(module, spec)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue