From 76dee53d35d364cabec8d104571e1ed1ede18db1 Mon Sep 17 00:00:00 2001 From: Joshua Hesketh Date: Thu, 3 Jul 2014 15:39:13 +1000 Subject: [PATCH] Fix LOG_PATH to use 7char uuid The zuul variable, LOG_PATH, is meant to be in the format of how openstack stores its logs. OpenStack actually only uses the first 7 characters of the uuid in the path so we need to limit what we send via the gearman variables here too Change-Id: I2a3260c242e1fe895c650df276951ef23d7dc7c9 --- tests/test_scheduler.py | 6 +++--- zuul/launcher/gearman.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/test_scheduler.py b/tests/test_scheduler.py index ceb15887be..dbcfd1b75b 100755 --- a/tests/test_scheduler.py +++ b/tests/test_scheduler.py @@ -2700,7 +2700,7 @@ For CI problems and help debugging, contact ci@example.org""" self.assertEqual( "https://storage.example.org/V1/AUTH_account/merge_logs/1/1/1/" "gate/test-merge/", - self.builds[0].parameters['SWIFT_logs_URL'][:-32]) + self.builds[0].parameters['SWIFT_logs_URL'][:-7]) self.assertEqual(5, len(self.builds[0].parameters['SWIFT_logs_HMAC_BODY']. split('\n'))) @@ -2709,7 +2709,7 @@ For CI problems and help debugging, contact ci@example.org""" self.assertEqual( "https://storage.example.org/V1/AUTH_account/logs/1/1/1/" "gate/test-test/", - self.builds[1].parameters['SWIFT_logs_URL'][:-32]) + self.builds[1].parameters['SWIFT_logs_URL'][:-7]) self.assertEqual(5, len(self.builds[1].parameters['SWIFT_logs_HMAC_BODY']. split('\n'))) @@ -2718,7 +2718,7 @@ For CI problems and help debugging, contact ci@example.org""" self.assertEqual( "https://storage.example.org/V1/AUTH_account/stash/1/1/1/" "gate/test-test/", - self.builds[1].parameters['SWIFT_MOSTLY_URL'][:-32]) + self.builds[1].parameters['SWIFT_MOSTLY_URL'][:-7]) self.assertEqual(5, len(self.builds[1]. parameters['SWIFT_MOSTLY_HMAC_BODY'].split('\n'))) diff --git a/zuul/launcher/gearman.py b/zuul/launcher/gearman.py index ec60f9ed45..57db7dc28a 100644 --- a/zuul/launcher/gearman.py +++ b/zuul/launcher/gearman.py @@ -302,7 +302,7 @@ class Gearman(object): # The destination_path is a unqiue path for this build request # and generally where the logs are expected to be placed destination_path = os.path.join(item.change.getBasePath(), - pipeline.name, job.name, uuid) + pipeline.name, job.name, uuid[:7]) params['BASE_LOG_PATH'] = item.change.getBasePath() params['LOG_PATH'] = destination_path