mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-28 14:39:07 +00:00
replace list(map(...)) with comprehension (#11590)
* replace `list(map(...))` with comprehension * add changelog frag
This commit is contained in:
parent
3194ed9d36
commit
ce5d5622b9
5 changed files with 51 additions and 52 deletions
|
|
@ -660,7 +660,7 @@ class DarwinTimezone(Timezone):
|
|||
# Lookup the list of supported timezones via `systemsetup -listtimezones`.
|
||||
# Note: Skip the first line that contains the label 'Time Zones:'
|
||||
out = self.execute(self.systemsetup, "-listtimezones").splitlines()[1:]
|
||||
tz_list = list(map(lambda x: x.strip(), out))
|
||||
tz_list = [x.strip() for x in out]
|
||||
if tz not in tz_list:
|
||||
self.abort(f'given timezone "{tz}" is not available')
|
||||
return tz
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue