mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 05:42:50 +00: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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user