[vhffs-dev] [835] Deleted Vhffs::Conf::get_pgsql_* stupid accessors |
[ Thread Index |
Date Index
| More vhffs.org/vhffs-dev Archives
]
Revision: 835
Author: gradator
Date: 2007-08-30 17:33:50 +0000 (Thu, 30 Aug 2007)
Log Message:
-----------
Deleted Vhffs::Conf::get_pgsql_* stupid accessors
Modified Paths:
--------------
trunk/vhffs-api/src/Vhffs/Conf.pm
trunk/vhffs-api/src/Vhffs/Robots/Pgsql.pm
trunk/vhffs-robots/src/pgsql_dump.pl
Modified: trunk/vhffs-api/src/Vhffs/Conf.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Conf.pm 2007-08-30 17:24:40 UTC (rev 834)
+++ trunk/vhffs-api/src/Vhffs/Conf.pm 2007-08-30 17:33:50 UTC (rev 835)
@@ -308,28 +308,6 @@
}
-
-sub get_pgsql_admin_pass
-{
- return $Config{"services"}{"pgsql"}{"password"};
-}
-
-sub get_pgsql_admin_host
-{
- return $Config{"services"}{"pgsql"}{"host"};
-}
-
-sub get_pgsql_admin_username
-{
- return $Config{"services"}{"pgsql"}{"username"};
-}
-
-sub get_pgsql_pgdump_path
-{
- return $Config{"services"}{"pgsql"}{"pgdump_path"};
-}
-
-
sub get_host_name
{
if( defined $Config{"global"}{host_name} )
Modified: trunk/vhffs-api/src/Vhffs/Robots/Pgsql.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Robots/Pgsql.pm 2007-08-30 17:24:40 UTC (rev 834)
+++ trunk/vhffs-api/src/Vhffs/Robots/Pgsql.pm 2007-08-30 17:33:50 UTC (rev 835)
@@ -100,9 +100,11 @@
{
use DBI;
my $vhffs = shift;
- my $dbuser = $vhffs->get_config->get_pgsql_admin_username;
- my $dbpass = $vhffs->get_config->get_pgsql_admin_pass;
- my $dbhost = $vhffs->get_config->get_pgsql_admin_host;
+ my $pgsqlconfig = $vhffs->get_config->get_service('pgsql');
+ my $dbuser = $pgsqlconfig->{'username'};
+ my $dbpass = $pgsqlconfig->{'password'};
+ my $dbhost = $pgsqlconfig->{'host'};
+
my $dbi;
if( $dbhost eq "localhost" )
{
Modified: trunk/vhffs-robots/src/pgsql_dump.pl
===================================================================
--- trunk/vhffs-robots/src/pgsql_dump.pl 2007-08-30 17:24:40 UTC (rev 834)
+++ trunk/vhffs-robots/src/pgsql_dump.pl 2007-08-30 17:33:50 UTC (rev 835)
@@ -48,16 +48,13 @@
Vhffs::Robots::lock( $vhffs , "dumppgsql" );
my $objs = Vhffs::Services::Pgsql::getall( $vhffs );
-my $admin_dbuser = $vhffs->get_config->get_pgsql_admin_username;
-my $admin_dbpass = $vhffs->get_config->get_pgsql_admin_pass;
-my $admin_dbhost = $vhffs->get_config->get_pgsql_admin_host;
-my $pgdumppath = $vhffs->get_config->get_pgsql_pgdump_path;
+my $pgsqlconfig = $vhffs->get_config->get_service('pgsql');
my $obj;
my $group;
my $groupname;
-die "Error, pg_dump is not present on this system in path \"$pgdumppath\"\n" unless( -x $pgdumppath );
+die "Error, pg_dump is not present on this system in path \"$pgsqlconfig->{'pgdump_path'}\"\n" unless( -x $pgsqlconfig->{'pgdump_path'} );
foreach $obj ( @{$objs} )
{
@@ -67,7 +64,7 @@
if( -d $dir )
{
my $file = $dir."/".$dbname.".pgsql.dump";
- my $cmd = "$pgdumppath -U $admin_dbuser -h $admin_dbhost -b -Fc -Z6 -f $file $dbname";
+ my $cmd = "$pgsqlconfig->{'pgdump_path'} -U $pgsqlconfig->{'username'} -h $pgsqlconfig->{'host'} -b -Fc -Z6 -f $file $dbname";
system( $cmd );
print $cmd."\n";