IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 10, 2014, 5:04:19 PM (12 years ago)
Author:
watersc1
Message:

Convert to use the correct way to get database information.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippScripts/scripts/stack_bkg_mk_mdc.pl

    r36810 r37738  
    1313
    1414my ($dbname,$stack_id,$label,$camera,$filter);
     15
     16my $ipprc =  PS::IPP::Config->new(); # IPP Configuration
     17my $siteConfig = $ipprc->{_siteConfig};
     18
    1519#$dbname = 'gpc1';
    1620#$camera = 'GPC1';
     
    2933
    3034use constant DB_SOCKET => '/var/run/mysqld/mysqld.sock';
    31 my $dbserver = 'ippdb01';
    32 my $dbuser = 'ippuser';
    33 my $dbpass = 'ippuser';
     35my $dbserver = metadataLookupStr($siteConfig, 'DBSERVER');
     36my $dbuser = metadataLookupStr($ipprc->{_siteConfig}, "RO_DBUSER");
     37my $dbpass = metadataLookupStr($ipprc->{_siteConfig}, "RO_DBPASSWORD");
     38die "database configuration not set up" unless defined($dbserver);
     39die "database configuration not set up" unless defined($dbuser);
     40die "database configuration not set up" unless defined($dbpass);
    3441my $db = DBI->connect("DBI:mysql:database=${dbname};host=${dbserver};" .
    3542                   "mysql_socket=" . DB_SOCKET(),
     
    3845    ) or die "Unable to connect to database $DBI::errstr\n";
    3946
    40 my $ipprc = PS::IPP::Config->new( $camera );
     47$ipprc = PS::IPP::Config->new( $camera );
    4148my $mdcParser = PS::IPP::Metadata::Config->new;
    4249
Note: See TracChangeset for help on using the changeset viewer.