Source: ironic Version: 1:5.1.2-2 Severity: wishlist Tags: patch User: [email protected] Usertags: timestamps X-Debbugs-Cc: [email protected]
Hi, Whilst working on the "reproducible builds" effort [0], we noticed that ironic could not be built reproducibly. Patch attached. [0] https://wiki.debian.org/ReproducibleBuilds Regards, -- ,''`. : :' : Chris Lamb `. `'` [email protected] / chris-lamb.co.uk `-
--- a/debian/patches/reproducible-build.patch 1970-01-01 02:00:00.000000000 +0200 --- b/debian/patches/reproducible-build.patch 2016-07-18 09:37:02.958933684 +0200 @@ -0,0 +1,29 @@ +Author: Chris Lamb <[email protected]> + +--- ironic-5.1.2.orig/ironic/api/controllers/v1/port.py ++++ ironic-5.1.2/ironic/api/controllers/v1/port.py +@@ -13,7 +13,9 @@ + # License for the specific language governing permissions and limitations + # under the License. + ++import os + import datetime ++import time + + from oslo_utils import uuidutils + import pecan +@@ -135,11 +137,12 @@ class Port(base.APIBase): + + @classmethod + def sample(cls, expand=True): ++ now = datetime.datetime.utcfromtimestamp(int(os.environ.get('SOURCE_DATE_EPOCH', time.time()))) + sample = cls(uuid='27e3153e-d5bf-4b7e-b517-fb518e17f34c', + address='fe:54:00:77:07:d9', + extra={'foo': 'bar'}, +- created_at=datetime.datetime.utcnow(), +- updated_at=datetime.datetime.utcnow()) ++ created_at=now, ++ updated_at=now) + # NOTE(lucasagomes): node_uuid getter() method look at the + # _node_uuid variable + sample._node_uuid = '7ae81bb3-dec3-4289-8d6c-da80bd8001ae' --- a/debian/patches/series 2016-07-18 09:21:14.319722511 +0200 --- b/debian/patches/series 2016-07-18 09:36:51.470749369 +0200 @@ -1,2 +1,3 @@ adds-alembic.ini-in-MANIFEST.in.patch allow-any-pytz-version.patch +reproducible-build.patch

