diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-05 16:16:47 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-05 16:16:47 +0000 |
commit | 7a7fb74454bb3a169acecd30e87067502bfe3260 (patch) | |
tree | d684cbea7ffc70bd39a1e52bb65b0ea5ae156bda /lib/ansible/vars/hostvars.py | |
parent | Adding upstream version 2.16.6. (diff) | |
download | ansible-core-7a7fb74454bb3a169acecd30e87067502bfe3260.tar.xz ansible-core-7a7fb74454bb3a169acecd30e87067502bfe3260.zip |
Adding upstream version 2.17.0.upstream/2.17.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'lib/ansible/vars/hostvars.py')
-rw-r--r-- | lib/ansible/vars/hostvars.py | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/lib/ansible/vars/hostvars.py b/lib/ansible/vars/hostvars.py index a76811b..bb0372e 100644 --- a/lib/ansible/vars/hostvars.py +++ b/lib/ansible/vars/hostvars.py @@ -15,9 +15,7 @@ # You should have received a copy of the GNU General Public License # along with Ansible. If not, see <http://www.gnu.org/licenses/>. -# Make coding more python3-ish -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type +from __future__ import annotations from collections.abc import Mapping @@ -93,8 +91,7 @@ class HostVars(Mapping): return self._find_host(host_name) is not None def __iter__(self): - for host in self._inventory.hosts: - yield host + yield from self._inventory.hosts def __len__(self): return len(self._inventory.hosts) @@ -128,8 +125,7 @@ class HostVarsVars(Mapping): return (var in self._vars) def __iter__(self): - for var in self._vars.keys(): - yield var + yield from self._vars.keys() def __len__(self): return len(self._vars.keys()) |