qvm-template: Fix timezone issues by storing timezone explictly in features
This commit is contained in:
parent
5a1e1b7fdd
commit
205eee4d80
@ -149,8 +149,8 @@ class TC_00_qvm_template(qubesadmin.tests.QubesTestCase):
|
|||||||
mock_rename,
|
mock_rename,
|
||||||
mock_remove):
|
mock_remove):
|
||||||
self.app.expected_calls[('dom0', 'admin.vm.List', None, None)] = b'0\0'
|
self.app.expected_calls[('dom0', 'admin.vm.List', None, None)] = b'0\0'
|
||||||
build_time = '2020-09-01 22:30:00' # 1598970600
|
build_time = '2020-09-01 14:30:00+00:00' # 1598970600
|
||||||
install_time = '2020-09-01 23:30:00.508230'
|
install_time = '2020-09-01 15:30:00.508230+00:00'
|
||||||
for key, val in [
|
for key, val in [
|
||||||
('name', 'test-vm'),
|
('name', 'test-vm'),
|
||||||
('epoch', '2'),
|
('epoch', '2'),
|
||||||
@ -280,8 +280,8 @@ class TC_00_qvm_template(qubesadmin.tests.QubesTestCase):
|
|||||||
mock_rename,
|
mock_rename,
|
||||||
mock_remove):
|
mock_remove):
|
||||||
self.app.expected_calls[('dom0', 'admin.vm.List', None, None)] = b'0\0'
|
self.app.expected_calls[('dom0', 'admin.vm.List', None, None)] = b'0\0'
|
||||||
build_time = '2020-09-01 22:30:00' # 1598970600
|
build_time = '2020-09-01 14:30:00+00:00' # 1598970600
|
||||||
install_time = '2020-09-01 23:30:00.508230'
|
install_time = '2020-09-01 15:30:00.508230+00:00'
|
||||||
for key, val in [
|
for key, val in [
|
||||||
('name', 'test-vm'),
|
('name', 'test-vm'),
|
||||||
('epoch', '2'),
|
('epoch', '2'),
|
||||||
|
@ -923,9 +923,10 @@ def install(
|
|||||||
tpl.features['template-reponame'] = reponame
|
tpl.features['template-reponame'] = reponame
|
||||||
tpl.features['template-buildtime'] = \
|
tpl.features['template-buildtime'] = \
|
||||||
str(datetime.datetime.fromtimestamp(
|
str(datetime.datetime.fromtimestamp(
|
||||||
int(package_hdr[rpm.RPMTAG_BUILDTIME])))
|
int(package_hdr[rpm.RPMTAG_BUILDTIME]),
|
||||||
|
tz=datetime.timezone.utc))
|
||||||
tpl.features['template-installtime'] = \
|
tpl.features['template-installtime'] = \
|
||||||
str(datetime.datetime.today())
|
str(datetime.datetime.today(tz=datetime.timezone.utc))
|
||||||
tpl.features['template-license'] = \
|
tpl.features['template-license'] = \
|
||||||
package_hdr[rpm.RPMTAG_LICENSE]
|
package_hdr[rpm.RPMTAG_LICENSE]
|
||||||
tpl.features['template-url'] = \
|
tpl.features['template-url'] = \
|
||||||
|
Loading…
Reference in New Issue
Block a user