Skip to contentSkip to conversation

config: Default Stash to $c{Logs}, not "logs"

PATCH In review Ian Jackson 2 participants 5 messages Jun 19, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 config: Default Stash to $c{Logs}, not "logs"

---
 Osstest.pm                  |    3 ++-
 production-config           |    1 -
 production-config-cambridge |    1 -
 3 files changed, 2 insertions(+), 3 deletions(-)
Osstest.pm +2 -1
index 8948666..fc46487 100644
@@ -60,7 +60,6 @@ our %c = qw(
     JobDB Standalone
     HostDB Static
 
-    Stash logs
     Images images
     Logs logs
     Results results
@@ -214,6 +213,8 @@ sub readglobalconfig () {
     $c{DefaultBranch} ||= 'xen-unstable';
 
     $c{DebianMirrorHost} ||= 'ftp.debian.org' if $c{DebianMirrorProxy};
+
+    $c{Stash} //= $c{Logs};
 }
 
 sub augmentconfigdefaults {
production-config +0 -1
index 47c0c4c..b17bd66 100644
@@ -34,7 +34,6 @@ QueueDaemonHost osstest
 
 ExecutiveDbnamePat dbname=osstestdb;host=db
 
-Stash /home/logs/logs
 Images /home/logs/images
 Logs /home/logs/logs
 
production-config-cambridge +0 -1
index 8f6fbe4..693690b 100644
@@ -32,7 +32,6 @@ NetNameservers 10.80.248.2 10.80.16.28 10.80.16.67
 
 Timezone Europe/London
 
-Stash /home/xc_osstest/logs
 Images /home/xc_osstest/images
 Logs /home/xc_osstest/logs
 
Signature · 1 line
1.7.10.4
#1 lore raw

PATCH 2/2 config: Computed defaults for Logs and Results

---
 Osstest.pm                  |    9 +++++++--
 production-config           |    2 --
 production-config-cambridge |    2 --
 3 files changed, 7 insertions(+), 6 deletions(-)
Osstest.pm +7 -2
index fc46487..c89c941 100644
@@ -61,8 +61,6 @@ our %c = qw(
     HostDB Static
 
     Images images
-    Logs logs
-    Results results
 
     DebianSuite wheezy
     DebianMirrorSubpath debian
@@ -214,6 +212,13 @@ sub readglobalconfig () {
 
     $c{DebianMirrorHost} ||= 'ftp.debian.org' if $c{DebianMirrorProxy};
 
+    my $pubbaseprefix = $c{PubBaseDir} ? "$c{PubBaseDir}/" : "";
+    foreach my $l (qw(logs results)) {
+	my $u = ucfirst $l;
+	next if defined $c{$u};
+	$c{"${u}"} = "$pubbaseprefix$l";
+    }
+
     $c{Stash} //= $c{Logs};
 }
 
production-config +0 -2
index b17bd66..bcb351e 100644
@@ -35,9 +35,7 @@ QueueDaemonHost osstest
 ExecutiveDbnamePat dbname=osstestdb;host=db
 
 Images /home/logs/images
-Logs /home/logs/logs
 
-Results /home/logs/results
 PubBaseDir /home/logs
 
 OverlayLocal /home/osstest/overlay-local
production-config-cambridge +0 -2
index 693690b..7b54a98 100644
@@ -33,9 +33,7 @@ NetNameservers 10.80.248.2 10.80.16.28 10.80.16.67
 Timezone Europe/London
 
 Images /home/xc_osstest/images
-Logs /home/xc_osstest/logs
 
-Results /home/xc_osstest/results
 PubBaseDir /home/xc_osstest
 
 OverlayLocal /export/home/osstest/overlay-local
Signature · 1 line
1.7.10.4
#3 lore raw

Re: [OSSTEST PATCH 2/2] config: Computed defaults for Logs and Results

Ian Campbell writes ("Re: [OSSTEST PATCH 2/2] config: Computed defaults for Logs and Results"):

Quoted 4 lines · Ian Jackson
Quoted 1 line

No functional change AFAICT.

Indeed.

I have collected these and your --reuse patch into a branch of miscellany.

Ian.