ros-infrastructure / ros_buildfarm

ROS buildfarm based on Docker
Apache License 2.0
81 stars 96 forks source link

Fix double minus sign on timezone #935

Closed v-lopez closed 2 years ago

v-lopez commented 2 years ago

Negative timezones would export a variable like ENV TZ CET--1 which python time library interprets as 24h difference, which causes errors.

cottsay commented 2 years ago

GitHub won't let me use the inline suggestion for this for some reason, but why don't we just let the string formatting take care of this?

        data['timezone'] = '%s%+03d' % (
            time.tzname[0], time.timezone / 60 / 60)
v-lopez commented 2 years ago

Makes sense, done.