removed deprecated first available file from tasks (#17643)

https://docs.ansible.com/ansible/porting_guide_2.0.html#deprecated
This commit is contained in:
Brian Coca 2016-09-27 12:31:46 -04:00 committed by GitHub
commit 3550f73837
4 changed files with 3 additions and 36 deletions

View file

@ -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 = {}