Fix bug where str is added to cached_hostset list
The original code was appending a str to a list rather than either
appending it or adding it as a list of one element. The code avoids
append to avoid unintentional side-effects.
Change-Id: I1466981f1d68f8dea3bbe32fdde6c4825056c0d0
Closes-Bug: #1927698
(cherry picked from commit e63c68d505
)
This commit is contained in:
parent
e18c02b3e9
commit
91d721f8b2
|
@ -1367,7 +1367,10 @@ def resolve_hosts_for(private_address, hostname):
|
||||||
if (not ch_ip.is_ipv6(private_address) and
|
if (not ch_ip.is_ipv6(private_address) and
|
||||||
hostname and
|
hostname and
|
||||||
hostname not in cached_hostset):
|
hostname not in cached_hostset):
|
||||||
return cached_hostset + hostname
|
hosts = cached_hostset + [hostname]
|
||||||
|
db.set(db_key, hosts)
|
||||||
|
db.flush()
|
||||||
|
return hosts
|
||||||
return cached_hostset
|
return cached_hostset
|
||||||
|
|
||||||
# Use a set to enforce uniqueness; order doesn't matter
|
# Use a set to enforce uniqueness; order doesn't matter
|
||||||
|
|
Loading…
Reference in New Issue