summaryrefslogtreecommitdiffstats
path: root/lib/ansible/vars/hostvars.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-05 16:16:49 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-05 16:16:49 +0000
commit48e387c5c12026a567eb7b293a3a590241c0cecb (patch)
tree80f2573be2d7d534b8ac4d2a852fe43f7ac35324 /lib/ansible/vars/hostvars.py
parentReleasing progress-linux version 2.16.6-1~progress7.99u1. (diff)
downloadansible-core-48e387c5c12026a567eb7b293a3a590241c0cecb.tar.xz
ansible-core-48e387c5c12026a567eb7b293a3a590241c0cecb.zip
Merging upstream version 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.py10
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())