Actually, putting it here makes more sense.
This commit is contained in:
parent
95e73f65a7
commit
d21e31d477
|
|
@ -131,10 +131,10 @@ def ask_for_additional_users(prompt='Any additional users to install (leave blan
|
||||||
|
|
||||||
def ask_for_a_timezone():
|
def ask_for_a_timezone():
|
||||||
while True:
|
while True:
|
||||||
timezone = input('Enter a valid timezone (examples: Europe/Stockholm, US/Eastern) or press enter to use UTC: ').strip()
|
timezone = input('Enter a valid timezone (examples: Europe/Stockholm, US/Eastern) or press enter to use UTC: ').strip().strip('*.')
|
||||||
if timezone == '':
|
if timezone == '':
|
||||||
timezone = 'UTC'
|
timezone = 'UTC'
|
||||||
if (pathlib.Path("/usr")/"share"/"zoneinfo"/timezone.strip('*.')).exists():
|
if (pathlib.Path("/usr")/"share"/"zoneinfo"/timezone).exists():
|
||||||
return timezone
|
return timezone
|
||||||
else:
|
else:
|
||||||
log(
|
log(
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue