[vhffs-dev] [834] Deleted Vhffs::Conf::get_mysql_* stupid accessors |
[ Thread Index |
Date Index
| More vhffs.org/vhffs-dev Archives
]
Revision: 834
Author: gradator
Date: 2007-08-30 17:24:40 +0000 (Thu, 30 Aug 2007)
Log Message:
-----------
Deleted Vhffs::Conf::get_mysql_* stupid accessors
Modified Paths:
--------------
trunk/vhffs-api/src/Vhffs/Conf.pm
trunk/vhffs-api/src/Vhffs/Robots/Mysql.pm
trunk/vhffs-robots/src/mysql_dump.pl
Modified: trunk/vhffs-api/src/Vhffs/Conf.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Conf.pm 2007-08-30 17:02:03 UTC (rev 833)
+++ trunk/vhffs-api/src/Vhffs/Conf.pm 2007-08-30 17:24:40 UTC (rev 834)
@@ -309,27 +309,6 @@
-sub get_mysql_admin_pass
-{
- return $Config{"services"}{"mysql"}{"password"};
-}
-
-sub get_mysql_admin_host
-{
- return $Config{"services"}{"mysql"}{"host"};
-}
-
-sub get_mysql_admin_username
-{
- return $Config{"services"}{"mysql"}{"username"};
-}
-
-sub get_mysql_mysqldump_path
-{
- return $Config{"services"}{"mysql"}{"mysqldump_path"};
-}
-
-
sub get_pgsql_admin_pass
{
return $Config{"services"}{"pgsql"}{"password"};
Modified: trunk/vhffs-api/src/Vhffs/Robots/Mysql.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Robots/Mysql.pm 2007-08-30 17:02:03 UTC (rev 833)
+++ trunk/vhffs-api/src/Vhffs/Robots/Mysql.pm 2007-08-30 17:24:40 UTC (rev 834)
@@ -123,9 +123,10 @@
{
use DBI;
my $vhffs = shift;
- my $dbuser = $vhffs->get_config->get_mysql_admin_username;
- my $dbpass = $vhffs->get_config->get_mysql_admin_pass;
- my $dbhost = $vhffs->get_config->get_mysql_admin_host;
+ my $mysqlconfig = $vhffs->get_config->get_service('mysql');
+ my $dbuser = $mysqlconfig->{'username'};
+ my $dbpass = $mysqlconfig->{'password'};
+ my $dbhost = $mysqlconfig->{'host'};
$dbi = DBI->connect( "DBI:mysql:dbname=mysql;host=$dbhost",$dbuser,$dbpass ) or return -1;
Modified: trunk/vhffs-robots/src/mysql_dump.pl
===================================================================
--- trunk/vhffs-robots/src/mysql_dump.pl 2007-08-30 17:02:03 UTC (rev 833)
+++ trunk/vhffs-robots/src/mysql_dump.pl 2007-08-30 17:24:40 UTC (rev 834)
@@ -48,16 +48,13 @@
Vhffs::Robots::lock( $vhffs , "dumpmysql" );
my $objs = Vhffs::Services::Mysql::getall( $vhffs );
-my $admin_dbuser = $vhffs->get_config->get_mysql_admin_username;
-my $admin_dbpass = $vhffs->get_config->get_mysql_admin_pass;
-my $admin_dbhost = $vhffs->get_config->get_mysql_admin_host;
-my $mysqldumppath = $vhffs->get_config->get_mysql_mysqldump_path;
+my $mysqlconf = $vhffs->get_config->get_service('mysql');
my $obj;
my $group;
my $groupname;
-die "Error, mysqldump is not present on this system in path \"$mysqldumppath\"\n" unless( -x $mysqldumppath );
+die "Error, mysqldump is not present on this system in path \"$mysqlconf->{'mysqldump_path'}\"\n" unless( -x $mysqlconf->{'mysqldump_path'} );
foreach $obj ( @{$objs} )
{
@@ -67,7 +64,7 @@
if( -d $dir )
{
my $file = $dir."/".$dbname.".mysql.dump";
- my $cmd = "$mysqldumppath -u $admin_dbuser -h $admin_dbhost -p$admin_dbpass $dbname > $file";
+ my $cmd = "$mysqlconf->{'mysqldump_path'} -u $mysqlconf->{'username'} -h $mysqlconf->{'host'} -p$mysqlconf->{'password'} $dbname > $file";
system( $cmd );
#Change the chmod if the backup succeed