IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 34018


Ignore:
Timestamp:
Jun 15, 2012, 1:21:25 PM (14 years ago)
Author:
mhuber
Message:

adding change for readonly DBSERVER,DBUSER,DBPASSWORD use instead of being hardcoded

Location:
trunk
Files:
2 edited

Legend:

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

    r34008 r34018  
    3232    exit($PS_EXIT_CONFIG_ERROR);
    3333}
     34
     35## for DB connection, want to use siteConfig DB settings
     36my $ipprc =  PS::IPP::Config->new(); # IPP Configuration
     37my $siteConfig = $ipprc->{_siteConfig};
    3438
    3539my $db;
     
    20522056
    20532057sub init_gpc_db {
    2054     ## change to use the site.config setting, however may want to use replicated scidbs instead
    2055     my $ipprc =  PS::IPP::Config->new(); # IPP Configuration
    2056     my $siteConfig = $ipprc->{_siteConfig};
     2058    ## change to use the siteConfig setting, while readonly probably do not want to use a readonly replicated DB incase it gets behind
     2059    my $dbserver = metadataLookupStr($siteConfig, 'DBSERVER');
     2060    my $dbuser = metadataLookupStr($ipprc->{_siteConfig}, "RO_DBUSER");
     2061    my $dbpass = metadataLookupStr($ipprc->{_siteConfig}, "RO_DBPASSWORD");
     2062    die "database configuration not set up" unless defined($dbserver);
     2063    die "database configuration not set up" unless defined($dbuser);
     2064    die "database configuration not set up" unless defined($dbpass);
     2065    #my $dbserver = 'ippdb01';
     2066    #my $dbuser = 'ippuser';
     2067    #my $dbpass = 'ippuser';
    20572068    use constant DB_SOCKET => '/var/run/mysqld/mysqld.sock';
    2058     # my $dbserver = 'ippdb01';
    2059     my $dbuser = 'ippuser';
    2060     my $dbpass = 'ippuser';
    2061     my $dbserver = metadataLookupStr($siteConfig, 'DBSERVER');
    2062     die "database configuration not set up" unless defined($dbserver);
    20632069    $db = DBI->connect("DBI:mysql:database=${dbname};host=${dbserver};" .
    20642070                       "mysql_socket=" . DB_SOCKET(),
  • trunk/tools/regpeek.pl

    r34008 r34018  
    44use Getopt::Long qw( GetOptions :config auto_help auto_version gnu_getopt );
    55use PS::IPP::Config 1.0.1 qw( :standard );
     6
     7my $ipprc =  PS::IPP::Config->new(); # IPP Configuration
     8my $siteConfig = $ipprc->{_siteConfig};
    69
    710my $dbname = 'gpc1';
     
    6669
    6770sub init_gpc_db {
    68     ## change to use the site.config setting now, however may want to use replicated scidbs instead
    69     my $ipprc =  PS::IPP::Config->new(); # IPP Configuration
    70     my $siteConfig = $ipprc->{_siteConfig};
     71    ## change to use the siteConfig setting, while readonly probably do not want to use a readonly replicated DB incase it gets behind
    7172    use constant DB_SOCKET => '/var/run/mysqld/mysqld.sock';
    72     # my $dbserver = 'ippdb01';
    73     my $dbuser = 'ippuser';
    74     my $dbpass = 'ippuser';
     73    #my $dbserver = 'ippdb01';
     74    #my $dbuser = 'ippuser';
     75    #my $dbpass = 'ippuser';
    7576    my $dbserver = metadataLookupStr($siteConfig, 'DBSERVER');
     77    my $dbuser = metadataLookupStr($ipprc->{_siteConfig}, "RO_DBUSER");
     78    my $dbpass = metadataLookupStr($ipprc->{_siteConfig}, "RO_DBPASSWORD");
    7679    die "database configuration not set up" unless defined($dbserver);
     80    die "database configuration not set up" unless defined($dbuser);
     81    die "database configuration not set up" unless defined($dbpass);
    7782    $db = DBI->connect("DBI:mysql:database=${dbname};host=${dbserver};" .
    7883                       "mysql_socket=" . DB_SOCKET(),
Note: See TracChangeset for help on using the changeset viewer.