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

system: T5555: Fix time-zone migrator changing valid time-zones to UTC #2217

Merged
merged 1 commit into from
Sep 7, 2023

Conversation

sarthurdev
Copy link
Member

Change Summary

The migration script system 13-to-14 executes find /usr/share/zoneinfo/posix -type f -or -type l | sed -e s:/usr/share/zoneinfo/posix/:: to find a list of valid timezones. This command only returns the first level of the timezones (continent etc.) resulting in the migrator changing valid timezones to UTC.

This PR changes the command to use timedatectl list-timezones

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes)
  • Migration from an old Vyatta component to vyos-1x, please link to related PR inside obsoleted component
  • Other (please describe):

Related Task(s)

Component(s) name

system

Proposed changes

How to test

Load config smoketests (ex. basic-vyos and dialup-router-medium-vpn have valid time-zones however are migrated to UTC)

Before:

>>> tz_datas = cmd('find /usr/share/zoneinfo/posix -type f -or -type l | sed -e s:/usr/share/zoneinfo/posix/::')
>>> tz_data = tz_datas.split("\n")
>>> 'Europe/Berlin' in tz_data
False
>>> 'Etc/GMT' in tz_data
False

After:

>>> tz_datas = cmd('timedatectl list-timezones')
>>> tz_data = tz_datas.split("\n")
>>> 'Etc/GMT' in tz_data
True
>>> 'Europe/Berlin' in tz_data
True

Checklist:

  • I have read the CONTRIBUTING document
  • I have linked this PR to one or more Phabricator Task(s)
  • I have run the components SMOKETESTS if applicable
  • My commit headlines contain a valid Task id
  • My change requires a change to the documentation
  • I have updated the documentation accordingly

@vyosbot vyosbot requested review from a team, dmbaturin, zdc, jestabro, sever-sever and c-po and removed request for a team September 7, 2023 12:47
@c-po c-po merged commit 05dd8ed into vyos:current Sep 7, 2023
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

3 participants