Changeset 131


Ignore:
Timestamp:
10/04/11 16:45:40 (13 years ago)
Author:
Kris Deugau
Message:

/trunk

Tweak config-loader to stop spitting errors if a config basename wasn't passed in.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/DNSDB.pm

    r130 r131  
    139139
    140140  # System defaults
    141   __cfgload("$configroot/dnsdb.conf") or $deferr = $errstr;
    142 
    143   # Per-site-ish settings
    144   unless (__cfgload("$configroot/$basename")) {
    145     $errstr = ($deferr ? "Error opening default config file $defconfig: $deferr\n" : '').
     141  __cfgload("$defconfig") or $deferr = $errstr;
     142
     143  # Per-site-ish settings.
     144  if ($basename ne '.conf') {
     145    unless (__cfgload("$siteconfig")) {
     146      $errstr = ($deferr ? "Error opening default config file $defconfig: $deferr\n" : '').
    146147        "Error opening site config file $siteconfig";
    147     return;
     148      return;
     149    }
    148150  }
    149151
     
    160162  $errstr = '';
    161163  my $cfgfile = shift;
     164
    162165  if (open CFG, "<$cfgfile") {
    163 #  my $mode = '';
    164166    while (<CFG>) {
    165167      chomp;
Note: See TracChangeset for help on using the changeset viewer.