mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-24 13:50:22 -07:00
removed deprecated first available file from tasks (#17643)
https://docs.ansible.com/ansible/porting_guide_2.0.html#deprecated
This commit is contained in:
parent
1b0b6b4c10
commit
3550f73837
4 changed files with 3 additions and 36 deletions
|
@ -792,29 +792,6 @@ class ActionBase(with_metaclass(ABCMeta, object)):
|
|||
display.debug(u"_low_level_execute_command() done: rc=%d, stdout=%s, stderr=%s" % (rc, out, err))
|
||||
return dict(rc=rc, stdout=out, stdout_lines=out.splitlines(), stderr=err)
|
||||
|
||||
def _get_first_available_file(self, faf, of=None, searchdir='files'):
|
||||
|
||||
display.deprecated("first_available_file, use with_first_found or lookup('first_found',...) instead")
|
||||
for fn in faf:
|
||||
fnt = self._templar.template(fn)
|
||||
if self._task._role is not None:
|
||||
lead = self._task._role._role_path
|
||||
else:
|
||||
lead = fnt
|
||||
fnd = self._loader.path_dwim_relative(lead, searchdir, fnt)
|
||||
|
||||
if not os.path.exists(fnd) and of is not None:
|
||||
if self._task._role is not None:
|
||||
lead = self._task._role._role_path
|
||||
else:
|
||||
lead = of
|
||||
fnd = self._loader.path_dwim_relative(lead, searchdir, of)
|
||||
|
||||
if os.path.exists(fnd):
|
||||
return fnd
|
||||
|
||||
return None
|
||||
|
||||
def _get_diff_data(self, destination, source, task_vars, source_file=True):
|
||||
|
||||
diff = {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue