summaryrefslogtreecommitdiff
path: root/ironic/api/controllers/v1/volume_target.py
diff options
context:
space:
mode:
authorThomas Goirand <zigo@debian.org>2016-08-09 17:09:54 +0200
committerRuby Loo <ruby.loo@intel.com>2017-10-03 15:33:28 -0400
commit57bba843160b6b0c20d85211556e69d51f332526 (patch)
tree5e239636bba89c954e38037fd22b6aac48d3e208 /ironic/api/controllers/v1/volume_target.py
parentfbc57abb170cb1210137d243ba4367402124b065 (diff)
downloadironic-57bba843160b6b0c20d85211556e69d51f332526.tar.gz
Makes ironic build reproducible
This changes the samples for port, volume_connector, and volume_target so that the updated_at and created_at values are constant times, similar to the node and chassis. This patch makes the build of Ironic reproducible. If you don't know about reproducible build, please read on: https://wiki.debian.org/ReproducibleBuilds https://wiki.debian.org/ReproducibleBuilds/About Debian has SOURCE_DATE_EPOCH set according to the last date of debian/changelog, which makes it so that the time is constant, and the build becomes reproducible. Change-Id: I302609bf53659e33e89cae223336a453052a5745 Co-Authored-By: Ruby Loo <ruby.loo@intel.com>
Diffstat (limited to 'ironic/api/controllers/v1/volume_target.py')
-rw-r--r--ironic/api/controllers/v1/volume_target.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/ironic/api/controllers/v1/volume_target.py b/ironic/api/controllers/v1/volume_target.py
index 8bddac636..2b901afe6 100644
--- a/ironic/api/controllers/v1/volume_target.py
+++ b/ironic/api/controllers/v1/volume_target.py
@@ -156,6 +156,7 @@ class VolumeTarget(base.APIBase):
@classmethod
def sample(cls, expand=True):
+ time = datetime.datetime(2000, 1, 1, 12, 0, 0)
properties = {"auth_method": "CHAP",
"auth_username": "XXX",
"auth_password": "XXX",
@@ -171,8 +172,8 @@ class VolumeTarget(base.APIBase):
volume_id='a2f3ff15-b3ea-4656-ab90-acbaa1a07607',
properties=properties,
extra={'foo': 'bar'},
- created_at=datetime.datetime.utcnow(),
- updated_at=datetime.datetime.utcnow())
+ created_at=time,
+ updated_at=time)
sample._node_uuid = '7ae81bb3-dec3-4289-8d6c-da80bd8001ae'
fields = None if expand else _DEFAULT_RETURN_FIELDS
return cls._convert_with_links(sample, 'http://localhost:6385',