You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by de...@apache.org on 2017/06/12 20:53:11 UTC

[2/2] incubator-trafficcontrol git commit: [TC-381] postinstall errors if "secrets" is missing from cdn.conf

[TC-381] postinstall errors if "secrets" is missing from cdn.conf

Also added a question for number of workers


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/9dbedf26
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/9dbedf26
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/9dbedf26

Branch: refs/heads/master
Commit: 9dbedf26c0abf793ff07c75644cf017c6b8bc475
Parents: bed60e8
Author: hbeatty <hb...@users.noreply.github.com>
Authored: Mon Jun 12 15:26:50 2017 -0400
Committer: Dewayne Richardson <de...@apache.org>
Committed: Mon Jun 12 14:52:59 2017 -0600

----------------------------------------------------------------------
 traffic_ops/install/bin/_postinstall | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/9dbedf26/traffic_ops/install/bin/_postinstall
----------------------------------------------------------------------
diff --git a/traffic_ops/install/bin/_postinstall b/traffic_ops/install/bin/_postinstall
index 4878d42..fbf1cf2 100755
--- a/traffic_ops/install/bin/_postinstall
+++ b/traffic_ops/install/bin/_postinstall
@@ -200,8 +200,17 @@ sub generateCdnConf {
         $cdnConf = Safe->new->rdo($fileName) or errorOut("Error loading $fileName: $@");
     }
     if ( lc $cdnConfiguration{genSecret} =~ /^y(?:es)?/ ) {
-        my @secrets   = @{ $cdnConf->{secrets} };
+        my @secrets;
         my $newSecret = InstallUtils::randomWord();
+
+        if (defined($cdnConf->{secrets})) {
+            @secrets   = @{ $cdnConf->{secrets} };
+            $cdnConf->{secrets} = \@secrets;
+            InstallUtils::logger( "Secrets found in cdn.conf file", "debug" );
+        } else {
+            $cdnConf->{secrets} = \@secrets;
+            InstallUtils::logger( "No secrets found in cdn.conf file", "debug" );
+        }
         unshift @secrets, InstallUtils::randomWord();
         if ( $cdnConfiguration{keepSecrets} > 0 && $#secrets > $cdnConfiguration{keepSecrets} - 1 ) {
 
@@ -209,7 +218,9 @@ sub generateCdnConf {
             $#secrets = $cdnConfiguration{keepSecrets} - 1;
         }
     }
+    $cdnConf->{hypnotoad}{workers} = $cdnConfiguration{workers};
     InstallUtils::writePerl( $fileName, $cdnConf );
+    InstallUtils::logger( "CDN configuration has been saved", "info" );
 }
 
 sub hash_pass {
@@ -417,6 +428,10 @@ sub getDefaults {
             {
                 "Number of secrets to keep?" => "10",
                 "config_var"                 => "keepSecrets"
+            },
+            {
+                "Number of workers?" => "96",
+                "config_var"         => "workers"
             }
         ],
         $ldapConfFile => [