[vhffs-dev] [2061] Reworked postresql robots

[ Thread Index | Date Index | More vhffs.org/vhffs-dev Archives ]


Revision: 2061
Author:   gradator
Date:     2012-02-25 22:52:38 +0100 (Sat, 25 Feb 2012)
Log Message:
-----------
Reworked postresql robots

Modified Paths:
--------------
    trunk/vhffs-api/src/Vhffs/Robots/Pgsql.pm
    trunk/vhffs-api/src/Vhffs/Services/Pgsql.pm
    trunk/vhffs-robots/Makefile.am

Added Paths:
-----------
    trunk/vhffs-robots/src/pgsql.pl

Removed Paths:
-------------
    trunk/vhffs-robots/src/pgsql_create.pl
    trunk/vhffs-robots/src/pgsql_delete.pl
    trunk/vhffs-robots/src/pgsql_modify.pl

Modified: trunk/vhffs-api/src/Vhffs/Robots/Pgsql.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Robots/Pgsql.pm	2012-02-25 21:15:22 UTC (rev 2060)
+++ trunk/vhffs-api/src/Vhffs/Robots/Pgsql.pm	2012-02-25 21:52:38 UTC (rev 2061)
@@ -31,105 +31,146 @@
 
 use strict;
 use utf8;
+use File::Path;
+use File::Basename;
+use File::Copy;
 
-package Vhffs::Robots::Pgsql;
-
-use Vhffs::Services::Pgsql;
 use Vhffs::Constants;
 use Vhffs::Functions;
+use Vhffs::Robots;
+use Vhffs::Services::Pgsql;
 
-sub update_db
-{
-	my $main = shift;
-	my $pg = shift;
+package Vhffs::Robots::Pgsql;
 
-	my $db = pgsql_admin_db_connect( $main );
+sub pgsql_admin_db_connect {
+	use DBI;
+	my $vhffs = shift;
+	my $pgsqlconfig = $vhffs->get_config->get_service('pgsql');
+	my $dbuser = $pgsqlconfig->{'username'};
+	my $dbpass = $pgsqlconfig->{'password'};
+	my $dbhost = $pgsqlconfig->{'host'};
 
-	if( defined $pg )
-	{
-		$db->do('ALTER USER '.$pg->get_dbusername.' WITH PASSWORD ?', undef, $pg->get_dbpassword);
-		$pg->set_status( Vhffs::Constants::ACTIVATED );
-		$pg->commit;
-		$pg->blank_password;
+	# TODO: Change that!
+	if( $dbhost eq 'localhost' ) {
+		return DBI->connect( 'DBI:Pg:dbname=postgres', $dbuser, $dbpass ) or return -1;
 	}
+
+	return DBI->connect( 'DBI:Pg:dbname=postgres;host='.$dbhost, $dbuser, $dbpass ) or return -1;
 }
 
+sub create {
+	my $pgsql = shift;
+	return undef unless defined $pgsql and $pgsql->get_status == Vhffs::Constants::WAITING_FOR_CREATION;
 
+	my $vhffs = $pgsql->get_main;
 
-sub create_db
-{
-	my $main = shift;
-	my $pg = shift;
+	my $dbi = pgsql_admin_db_connect( $vhffs );
+	return unless $dbi;
 
-	my $db = pgsql_admin_db_connect( $main );
+	unless( $dbi->do('CREATE USER '.$pgsql->get_dbusername.' WITH PASSWORD ?', undef, $pgsql->get_dbpassword) ) {
+		$pgsql->set_status( Vhffs::Constants::CREATION_ERROR );
+		$pgsql->commit;
+		Vhffs::Robots::vhffs_log( $vhffs, 'An error occured while creating user '.$pgsql->get_dbusername.' for pgsql database '.$pgsql->get_dbname );
+		return undef;
+	}
 
-	if( defined $pg )
-	{
-		$db->do('CREATE USER '.$pg->get_dbusername.' WITH PASSWORD ?', undef, $pg->get_dbpassword);
-		$db->do('CREATE DATABASE '.$pg->get_dbname.' OWNER '.$pg->get_dbusername );
-		$pg->set_status( Vhffs::Constants::ACTIVATED );	
-		$pg->commit;
-		$pg->blank_password;
+	unless( $dbi->do('CREATE DATABASE '.$pgsql->get_dbname.' OWNER '.$pgsql->get_dbusername ) ) {
+		$pgsql->set_status( Vhffs::Constants::CREATION_ERROR );
+		$pgsql->commit;
+		Vhffs::Robots::vhffs_log( $vhffs, 'An error occured while creating pgsql database '.$pgsql->get_dbname );
+		return undef;
 	}
+
+	$dbi->disconnect;
+
+	Vhffs::Robots::vhffs_log( $vhffs, 'Created pgsql database '.$pgsql->get_dbname );
+	$pgsql->blank_password;
+	$pgsql->set_status( Vhffs::Constants::ACTIVATED );	
+	$pgsql->commit;
+
+	return 1;
 }
 
-sub delete_db
-{
-	my $main = shift;
-	my $pg = shift;
+sub delete {
+	my $pgsql = shift;
+	return undef unless defined $pgsql and $pgsql->get_status == Vhffs::Constants::WAITING_FOR_DELETION;
 
-	my $pgsqlconfig = $main->get_config->get_service('pgsql');
-	my $robotconf = $main->get_config->get_robots;
+	my $vhffs = $pgsql->get_main;
+	my $pgsqlconfig = $vhffs->get_config->get_service('pgsql');
 
-	my $db = pgsql_admin_db_connect( $main );
-	return unless $db;
+	my $dbi = pgsql_admin_db_connect( $vhffs );
+	return unless $dbi;
 
-	if( ( defined $pg ) && ( $pg->get_status == Vhffs::Constants::WAITING_FOR_DELETION )  )
-	{
-		$pg->add_history("Ok, robots will erase all data");
+	# Replace user password with another password (we don't care which one), to set the database more or less read-only
+	unless( $dbi->do('ALTER USER '.$pgsql->get_dbusername.' WITH PASSWORD ?', undef, $pgsqlconfig->{'password'}) ) {
+		$pgsql->set_status( Vhffs::Constants::DELETION_ERROR );
+		$pgsql->commit;
+		Vhffs::Robots::vhffs_log( $vhffs, 'An error occured while revoking privileges from pgsql database '.$pgsql->get_dbname.' for '.$pgsql->get_dbusername );
+		return undef;
+	}
 
-		# Replace user password with another password (we don't care which one), to set the database more or less read-only
-		$db->do('ALTER USER '.$pg->get_dbusername.' WITH PASSWORD ?', undef, $pgsqlconfig->{'password'});
+	# Dump the database after access are removed (thus setting the database read-only) and just before dropping it
+	my $tmpfile = _dump( $pgsql );
+	if( defined $tmpfile ) {
+		my $file = $vhffs->get_config->get_robots->{'archive_deleted_path'}.'/'.time().'_'.$pgsql->get_group->get_groupname.'_pgsql_'.$pgsql->get_dbname.'.dump';
+		require File::Copy;
+		File::Copy::move( $tmpfile , $file );
+	}
 
-		# Dump the database after access are removed (thus setting the database read-only) and just before dropping it
-		my $tmpfile = _dump( $pg );
-		if( defined $tmpfile ) {
-			my $file = $robotconf->{'archive_deleted_path'}.'/'.time().'_'.$pg->get_group->get_groupname.'_pgsql_'.$pg->get_dbname.'.dump';
-			require File::Copy;
-			File::Copy::move( $tmpfile , $file );
-		}
+	unless( $dbi->do( 'DROP DATABASE '.$pgsql->get_dbname ) ) {
+		$pgsql->set_status( Vhffs::Constants::DELETION_ERROR );
+		$pgsql->commit;
+		Vhffs::Robots::vhffs_log( $vhffs, 'An error occured while removing pgsql database '.$pgsql->get_dbname );
+		return undef;
+	}
 
-		$db->do("DROP DATABASE ".$pg->get_dbname );
-		$db->do("DROP USER " . $pg->get_dbusername );	
-		$pg->add_history("All data have been erased");
+	unless( $dbi->do( 'DROP USER '.$pgsql->get_dbusername ) ) {
+		$pgsql->set_status( Vhffs::Constants::DELETION_ERROR );
+		$pgsql->commit;
+		Vhffs::Robots::vhffs_log( $vhffs, 'An error occured while removing pgsql database '.$pgsql->get_dbname );
+		return undef;
+	}
 
-		if( $pg->delete < 0 )
-		{
-			$pg->add_history("Cannot be delete from database");
-		}
+	$dbi->disconnect;
+
+	if( $pgsql->delete ) {
+		Vhffs::Robots::vhffs_log( $vhffs, 'Deleted pgsql database '.$pgsql->get_dbname );
+	} else {
+		$pgsql->set_status( Vhffs::Constants::DELETION_ERROR );
+		$pgsql->commit;
+		Vhffs::Robots::vhffs_log( $vhffs, 'An error occured while deleting pgsql database '.$pgsql->get_dbname.' object' );
+		return undef;
 	}
+
+	return 1;
 }
 
+sub modify {
+	my $pgsql = shift;
+	return undef unless defined $pgsql and $pgsql->get_status == Vhffs::Constants::WAITING_FOR_MODIFICATION;
 
+	my $vhffs = $pgsql->get_main;
 
-sub pgsql_admin_db_connect
-{
-	use DBI;
-	my $vhffs = shift;
-	my $pgsqlconfig = $vhffs->get_config->get_service('pgsql');
-	my $dbuser = $pgsqlconfig->{'username'};
-	my $dbpass = $pgsqlconfig->{'password'};
-	my $dbhost = $pgsqlconfig->{'host'};
+	my $dbi = pgsql_admin_db_connect( $vhffs );
+	return unless $dbi;
 
-	my $dbi;
-	if( $dbhost eq "localhost" ) {
-		$dbi = DBI->connect( "DBI:Pg:dbname=postgres",$dbuser,$dbpass ) or return -1;
+	if( $pgsql->get_dbpassword ) {
+		unless( $dbi->do( 'ALTER USER '.$pgsql->get_dbusername.' WITH PASSWORD ?', undef, $pgsql->get_dbpassword ) ) {
+			$pgsql->set_status( Vhffs::Constants::MODIFICATION_ERROR );
+			$pgsql->commit;
+			Vhffs::Robots::vhffs_log( $vhffs, 'An error occured while modifying pgsql database '.$pgsql->get_dbname );
+			return undef;
+		}
+		$pgsql->blank_password;
+		$pgsql->add_history( 'Password changed' );
+		Vhffs::Robots::vhffs_log( $vhffs, 'Password changed for pgsql database '.$pgsql->get_dbname );
 	}
-	else {
-		$dbi = DBI->connect( "DBI:Pg:dbname=postgres;host=$dbhost",$dbuser,$dbpass ) or return -1;
-	}
 
-	return $dbi;
+	$dbi->disconnect;
+
+	$pgsql->set_status( Vhffs::Constants::ACTIVATED );
+	$pgsql->commit;
+	return 1;
 }
 
 sub _dump {
@@ -187,7 +228,7 @@
 	my $pg = shift;
 
 	my $dir = $pg->get_group->get_dir;
-	return unless -d $dir;
+	return undef unless -d $dir;
 	my $file = $dir.'/'.$pg->get_dbname.'.pgsql.dump';
 
 	my $tmpfile = _dump($pg);
@@ -197,6 +238,8 @@
 	chown( $pg->get_owner_uid , $pg->get_owner_gid , $tmpfile );
 	require File::Copy;
 	File::Copy::move( $tmpfile , $file );
+
+	return 1;
 }
 
 1;

Modified: trunk/vhffs-api/src/Vhffs/Services/Pgsql.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Services/Pgsql.pm	2012-02-25 21:15:22 UTC (rev 2060)
+++ trunk/vhffs-api/src/Vhffs/Services/Pgsql.pm	2012-02-25 21:52:38 UTC (rev 2061)
@@ -267,6 +267,8 @@
 
 	my $request = $self->{'db'}->prepare('UPDATE vhffs_pgsql SET dbpass=\'\' WHERE pgsql_id=?') or return -1;
 	$request->execute( $self->{pgsql_id} );
+
+	$self->{'dbpass'} = '';
 	return 1;
 }
 

Modified: trunk/vhffs-robots/Makefile.am
===================================================================
--- trunk/vhffs-robots/Makefile.am	2012-02-25 21:15:22 UTC (rev 2060)
+++ trunk/vhffs-robots/Makefile.am	2012-02-25 21:52:38 UTC (rev 2061)
@@ -35,10 +35,8 @@
 	src/mysql.pl \
 	src/mysql_dump.pl \
 	src/object_cleanup.pl \
-	src/pgsql_create.pl \
-	src/pgsql_delete.pl \
+	src/pgsql.pl \
 	src/pgsql_dump.pl \
-	src/pgsql_modify.pl \
 	src/repository.pl \
 	src/repository_quota.pl \
 	src/repository_stats.pl \

Copied: trunk/vhffs-robots/src/pgsql.pl (from rev 2056, trunk/vhffs-robots/src/pgsql_create.pl)
===================================================================
--- trunk/vhffs-robots/src/pgsql.pl	                        (rev 0)
+++ trunk/vhffs-robots/src/pgsql.pl	2012-02-25 21:52:38 UTC (rev 2061)
@@ -0,0 +1,59 @@
+#!%PERL%
+# Copyright (c) vhffs project and its contributors
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without 
+# modification, are permitted provided that the following conditions 
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright 
+#   notice, this list of conditions and the following disclaimer.
+#2. Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in 
+#   the documentation and/or other materials provided with the 
+#   distribution.
+#3. Neither the name of vhffs nor the names of its contributors 
+#   may be used to endorse or promote products derived from this 
+#   software without specific prior written permission.
+#
+#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+#"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
+#LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
+#FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
+#COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
+#INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 
+#BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
+#LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 
+#CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
+# POSSIBILITY OF SUCH DAMAGE.
+
+use strict;
+use utf8;
+
+use lib '%VHFFS_LIB_DIR%';
+use Vhffs::Robots::Pgsql;
+
+my $vhffs = init Vhffs::Main;
+exit 1 unless defined $vhffs;
+
+Vhffs::Robots::lock( $vhffs, 'pgsql' );
+
+my $repos = Vhffs::Services::Pgsql::getall( $vhffs, Vhffs::Constants::WAITING_FOR_CREATION );
+foreach ( @{$repos} ) {
+	Vhffs::Robots::Pgsql::create( $_ );
+}
+
+$repos = Vhffs::Services::Pgsql::getall( $vhffs, Vhffs::Constants::WAITING_FOR_DELETION );
+foreach ( @{$repos} ) {
+	Vhffs::Robots::Pgsql::delete( $_ );
+}
+
+$repos = Vhffs::Services::Pgsql::getall( $vhffs, Vhffs::Constants::WAITING_FOR_MODIFICATION );
+foreach ( @{$repos} ) {
+	Vhffs::Robots::Pgsql::modify( $_ );
+}
+
+Vhffs::Robots::unlock( $vhffs, 'pgsql' );
+exit 0;

Deleted: trunk/vhffs-robots/src/pgsql_create.pl
===================================================================
--- trunk/vhffs-robots/src/pgsql_create.pl	2012-02-25 21:15:22 UTC (rev 2060)
+++ trunk/vhffs-robots/src/pgsql_create.pl	2012-02-25 21:52:38 UTC (rev 2061)
@@ -1,62 +0,0 @@
-#!%PERL%
-# Copyright (c) vhffs project and its contributors
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without 
-# modification, are permitted provided that the following conditions 
-# are met:
-#
-# 1. Redistributions of source code must retain the above copyright 
-#   notice, this list of conditions and the following disclaimer.
-#2. Redistributions in binary form must reproduce the above copyright
-#   notice, this list of conditions and the following disclaimer in 
-#   the documentation and/or other materials provided with the 
-#   distribution.
-#3. Neither the name of vhffs nor the names of its contributors 
-#   may be used to endorse or promote products derived from this 
-#   software without specific prior written permission.
-#
-#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-#"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-#LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-#FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-#COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
-#INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 
-#BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
-#LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 
-#CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 
-# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
-# POSSIBILITY OF SUCH DAMAGE.
-
-use strict;
-use utf8;
-
-use lib '%VHFFS_LIB_DIR%';
-use Vhffs::Robots::Pgsql;
-use Vhffs::Main;
-use Vhffs::Robots;
-
-
-my $vhffs = init Vhffs::Main;
-
-Vhffs::Robots::lock( $vhffs , "pgsql" );
-
-my $dbs = Vhffs::Services::Pgsql::getall( $vhffs , Vhffs::Constants::WAITING_FOR_CREATION );
-my $db;
-
-foreach $db ( @{$dbs} )
-{
-	if( Vhffs::Robots::Pgsql::create_db( $vhffs , $db ) < 0 )
-	{
-		Vhffs::Robots::vhffs_log( $vhffs, sprintf("Cannot create PostgreSQL database %s",$db->get_dbname) );
-	}
-	else
-	{
-		Vhffs::Robots::vhffs_log( $vhffs, sprintf("Create PostgreSQL database %s",$db->get_dbname) );
-	}
-}
-
-
-Vhffs::Robots::unlock( $vhffs , "pgsql" );
-exit( 0 );

Deleted: trunk/vhffs-robots/src/pgsql_delete.pl
===================================================================
--- trunk/vhffs-robots/src/pgsql_delete.pl	2012-02-25 21:15:22 UTC (rev 2060)
+++ trunk/vhffs-robots/src/pgsql_delete.pl	2012-02-25 21:52:38 UTC (rev 2061)
@@ -1,64 +0,0 @@
-#!%PERL%
-# Copyright (c) vhffs project and its contributors
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without 
-# modification, are permitted provided that the following conditions 
-# are met:
-#
-# 1. Redistributions of source code must retain the above copyright 
-#   notice, this list of conditions and the following disclaimer.
-#2. Redistributions in binary form must reproduce the above copyright
-#   notice, this list of conditions and the following disclaimer in 
-#   the documentation and/or other materials provided with the 
-#   distribution.
-#3. Neither the name of vhffs nor the names of its contributors 
-#   may be used to endorse or promote products derived from this 
-#   software without specific prior written permission.
-#
-#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-#"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-#LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-#FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-#COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
-#INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 
-#BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
-#LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 
-#CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 
-# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
-# POSSIBILITY OF SUCH DAMAGE.
-
-use strict;
-use utf8;
-
-use lib '%VHFFS_LIB_DIR%';
-use Vhffs::Robots;
-use Vhffs::Services::Pgsql;
-use Vhffs::Robots::Pgsql;
-use Vhffs::Main;
-
-my $vhffs = init Vhffs::Main;
-
-Vhffs::Robots::lock( $vhffs , "pgsql" );
-
-my $dbs = Vhffs::Services::Pgsql::getall( $vhffs , Vhffs::Constants::WAITING_FOR_DELETION , undef , undef  );
-my $db;
-
-
-foreach $db ( @{$dbs} )
-{
-	if(  Vhffs::Robots::Pgsql::delete_db( $vhffs , $db ) < 0 )
-	{
-		Vhffs::Robots::vhffs_log( $vhffs, sprintf( "Cannot delete PostgreSQL database %s" , $db->get_dbname ));
-	}
-	else
-	{
-		Vhffs::Robots::vhffs_log( $vhffs, sprintf( "Delete PostgreSQL database %s" , $db->get_dbname ));
-	}
-}
-
-Vhffs::Robots::unlock( $vhffs , "pgsql" );
-
-exit 0;
-

Deleted: trunk/vhffs-robots/src/pgsql_modify.pl
===================================================================
--- trunk/vhffs-robots/src/pgsql_modify.pl	2012-02-25 21:15:22 UTC (rev 2060)
+++ trunk/vhffs-robots/src/pgsql_modify.pl	2012-02-25 21:52:38 UTC (rev 2061)
@@ -1,56 +0,0 @@
-#!%PERL%
-# Copyright (c) vhffs project and its contributors
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without 
-# modification, are permitted provided that the following conditions 
-# are met:
-#
-# 1. Redistributions of source code must retain the above copyright 
-#   notice, this list of conditions and the following disclaimer.
-#2. Redistributions in binary form must reproduce the above copyright
-#   notice, this list of conditions and the following disclaimer in 
-#   the documentation and/or other materials provided with the 
-#   distribution.
-#3. Neither the name of vhffs nor the names of its contributors 
-#   may be used to endorse or promote products derived from this 
-#   software without specific prior written permission.
-#
-#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-#"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-#LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-#FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-#COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
-#INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 
-#BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
-#LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 
-#CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 
-# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
-# POSSIBILITY OF SUCH DAMAGE.
-
-use strict;
-use utf8;
-
-use lib '%VHFFS_LIB_DIR%';
-use Vhffs::Robots;
-use Vhffs::Services::Pgsql;
-use Vhffs::Robots::Pgsql;
-use Vhffs::Main;
-
-
-my $vhffs = init Vhffs::Main;
-
-Vhffs::Robots::lock( $vhffs , "pgsql" );
-
-my $dbs = Vhffs::Services::Pgsql::getall( $vhffs , Vhffs::Constants::WAITING_FOR_MODIFICATION , undef , undef );
-my $db;
-
-foreach $db ( @{$dbs} )
-{
-	Vhffs::Robots::Pgsql::update_db( $vhffs , $db );
-}
-
-Vhffs::Robots::unlock( $vhffs , "pgsql" );
-
-exit 0;


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/