use static timestamps for api samples

Building ceilometer cannot be done in a reproducible manner,
due to the use of timestamps.

If you don't know about reproducible builds, please read on:
https://wiki.debian.org/ReproducibleBuilds
https://wiki.debian.org/ReproducibleBuilds/About

This patch is a forward of the Debian bug patch sent here:
https://bugs.debian.org/820179

Change-Id: Iddb746eaa03386b69f746f9ff2cef09e686ebd8b
Closes-Bug: #1572432
This commit is contained in:
gordon chung 2016-04-20 08:29:49 -04:00
parent aa8497d93f
commit 72687f5637
4 changed files with 6 additions and 7 deletions

View File

@ -143,7 +143,7 @@ class Event(base.Base):
def sample(cls):
return cls(
event_type='compute.instance.update',
generated=datetime.datetime(2015, 1, 1, 12, 30, 59, 123456),
generated=datetime.datetime(2015, 1, 1, 12, 0, 0, 0),
message_id='94834db1-8f1b-404d-b2ec-c35901f1b7f0',
traits={
Trait(name='request_id',

View File

@ -116,8 +116,8 @@ class OldSample(base.Base):
resource_id='bd9431c1-8d69-4ad3-803a-8d4a6b89fd36',
project_id='35b17138-b364-4e6a-a131-8f3099c5be68',
user_id='efd87807-12d2-4b38-9c70-5f5c2ac427ff',
recorded_at=datetime.datetime.utcnow(),
timestamp=datetime.datetime.utcnow(),
recorded_at=datetime.datetime(2015, 1, 1, 12, 0, 0, 0),
timestamp=datetime.datetime(2015, 1, 1, 12, 0, 0, 0),
resource_metadata={'name1': 'value1',
'name2': 'value2'},
message_id='5460acce-4fd6-480d-ab18-9735ec7b1996',

View File

@ -71,7 +71,7 @@ class Resource(base.Base):
resource_id='bd9431c1-8d69-4ad3-803a-8d4a6b89fd36',
project_id='35b17138-b364-4e6a-a131-8f3099c5be68',
user_id='efd87807-12d2-4b38-9c70-5f5c2ac427ff',
timestamp=datetime.datetime.utcnow(),
timestamp=datetime.datetime(2015, 1, 1, 12, 0, 0, 0),
source="openstack",
metadata={'name1': 'value1',
'name2': 'value2'},

View File

@ -21,7 +21,6 @@
import datetime
import uuid
from oslo_utils import timeutils
import pecan
from pecan import rest
from wsme import types as wtypes
@ -99,8 +98,8 @@ class Sample(base.Base):
resource_id='bd9431c1-8d69-4ad3-803a-8d4a6b89fd36',
project_id='35b17138-b364-4e6a-a131-8f3099c5be68',
user_id='efd87807-12d2-4b38-9c70-5f5c2ac427ff',
timestamp=timeutils.utcnow(),
recorded_at=datetime.datetime.utcnow(),
timestamp=datetime.datetime(2015, 1, 1, 12, 0, 0, 0),
recorded_at=datetime.datetime(2015, 1, 1, 12, 0, 0, 0),
source='openstack',
metadata={'name1': 'value1',
'name2': 'value2'},