Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

inventory/aws_ec2: drop := operator because we still support py3.6 #1098

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions changelogs/fragments/inventory-aws_ec2-avoid-py38-syntax.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
trivial:
- "inventory/aws_ec2 - Avoid the := operator (py3.8+) because we still support Python 3.6."
4 changes: 2 additions & 2 deletions plugins/inventory/aws_ec2.py
Original file line number Diff line number Diff line change
Expand Up @@ -774,9 +774,9 @@ def iter_entry(self, hosts, hostnames, allow_duplicated_hosts=False, hostvars_pr
for host in hosts:
if allow_duplicated_hosts:
hostname_list = self.get_all_hostnames(host, hostnames)
elif preferred_hostname := self._get_preferred_hostname(host, hostnames):
hostname_list = [preferred_hostname]
else:
hostname_list = [self._get_preferred_hostname(host, hostnames)]
if not hostname_list or hostname_list[0] is None:
continue

host_vars = self.prepare_host_vars(
Expand Down