[vhffs-dev] [2059] added missing return values

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


Revision: 2059
Author:   gradator
Date:     2012-02-25 22:14:33 +0100 (Sat, 25 Feb 2012)
Log Message:
-----------
added missing return values

Modified Paths:
--------------
    trunk/vhffs-api/src/Vhffs/Robots/Cron.pm
    trunk/vhffs-api/src/Vhffs/Robots/DNS.pm
    trunk/vhffs-api/src/Vhffs/Robots/Group.pm
    trunk/vhffs-api/src/Vhffs/Robots/Repository.pm
    trunk/vhffs-api/src/Vhffs/Robots/User.pm
    trunk/vhffs-api/src/Vhffs/Robots/Web.pm

Modified: trunk/vhffs-api/src/Vhffs/Robots/Cron.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Robots/Cron.pm	2012-02-25 18:48:38 UTC (rev 2058)
+++ trunk/vhffs-api/src/Vhffs/Robots/Cron.pm	2012-02-25 21:14:33 UTC (rev 2059)
@@ -79,6 +79,8 @@
 	$cron->set_status( Vhffs::Constants::ACTIVATED );
 	$cron->commit;
 	Vhffs::Robots::vhffs_log( $vhffs, 'Created cron job '.$cron->get_cronpath );
+
+	return 1;
 }
 
 sub delete {
@@ -92,8 +94,11 @@
 	} else {
 		Vhffs::Robots::vhffs_log( $vhffs, 'An error occured while deleting cron job '.$cron->get_cronpath );
 		$cron->set_status( Vhffs::Constants::DELETION_ERROR );
-		$cron->commit();
+		$cron->commit;
+		return undef;
 	}
+
+	return 1;
 }
 
 sub modify {
@@ -101,6 +106,7 @@
 	return undef unless defined $cron and $cron->get_status == Vhffs::Constants::WAITING_FOR_MODIFICATION;
 	$cron->set_status( Vhffs::Constants::ACTIVATED );
 	$cron->commit;
+	return 1;
 }
 
 1;

Modified: trunk/vhffs-api/src/Vhffs/Robots/DNS.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Robots/DNS.pm	2012-02-25 18:48:38 UTC (rev 2058)
+++ trunk/vhffs-api/src/Vhffs/Robots/DNS.pm	2012-02-25 21:14:33 UTC (rev 2059)
@@ -48,6 +48,8 @@
 	$dns->set_status( Vhffs::Constants::ACTIVATED );
 	$dns->commit;
 	Vhffs::Robots::vhffs_log( $vhffs, 'Created DNS '.$dns->get_domain );
+
+	return 1;
 }
 
 sub delete {
@@ -62,7 +64,10 @@
 		Vhffs::Robots::vhffs_log( $vhffs, 'An error occured while deleting DNS '.$dns->get_domain );
 		$dns->set_status( Vhffs::Constants::DELETION_ERROR );
 		$dns->commit();
+		return undef;
 	}
+
+	return 1;
 }
 
 sub modify {
@@ -70,6 +75,7 @@
 	return undef unless defined $dns and $dns->get_status == Vhffs::Constants::WAITING_FOR_MODIFICATION;
 	$dns->set_status( Vhffs::Constants::ACTIVATED );
 	$dns->commit;
+	return 1;
 }
 
 1;

Modified: trunk/vhffs-api/src/Vhffs/Robots/Group.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Robots/Group.pm	2012-02-25 18:48:38 UTC (rev 2058)
+++ trunk/vhffs-api/src/Vhffs/Robots/Group.pm	2012-02-25 21:14:33 UTC (rev 2059)
@@ -73,6 +73,8 @@
 	Vhffs::Robots::vhffs_log( $vhffs, 'Created group '.$group->get_groupname );
 	$group->set_status( Vhffs::Constants::ACTIVATED );	
 	$group->commit;
+
+	return 1;
 }
 
 sub delete {
@@ -134,6 +136,7 @@
 	return undef unless defined $user and $user->get_status == Vhffs::Constants::WAITING_FOR_MODIFICATION;
 	$user->set_status( Vhffs::Constants::ACTIVATED );
 	$user->commit;
+	return 1;
 }
 
 #TODO: Rework everything below this line

Modified: trunk/vhffs-api/src/Vhffs/Robots/Repository.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Robots/Repository.pm	2012-02-25 18:48:38 UTC (rev 2058)
+++ trunk/vhffs-api/src/Vhffs/Robots/Repository.pm	2012-02-25 21:14:33 UTC (rev 2059)
@@ -50,7 +50,7 @@
 
 	if( -e $dir ) {
 		$repository->set_status( Vhffs::Constants::CREATION_ERROR );
-		$repository->commit();
+		$repository->commit;
 		Vhffs::Robots::vhffs_log( $vhffs, 'An error occured while creating downloads repository '.$repository->get_name.' to the filesystem' );
 		return undef;
 	}
@@ -75,6 +75,8 @@
 	Vhffs::Robots::vhffs_log( $vhffs, 'Created downloads repository '.$repository->get_name );
 	$repository->set_status( Vhffs::Constants::ACTIVATED );	
 	$repository->commit;
+
+	return 1;
 }
 
 sub delete {
@@ -117,6 +119,7 @@
 	return undef unless defined $repository and $repository->get_status == Vhffs::Constants::WAITING_FOR_MODIFICATION;
 	$repository->set_status( Vhffs::Constants::ACTIVATED );
 	$repository->commit;
+	return 1;
 }
 
 1;

Modified: trunk/vhffs-api/src/Vhffs/Robots/User.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Robots/User.pm	2012-02-25 18:48:38 UTC (rev 2058)
+++ trunk/vhffs-api/src/Vhffs/Robots/User.pm	2012-02-25 21:14:33 UTC (rev 2059)
@@ -74,6 +74,8 @@
 	Vhffs::Robots::vhffs_log( $vhffs, 'Created home dir for user '.$user->get_username );
 	$user->set_status( Vhffs::Constants::ACTIVATED );	
 	$user->commit;
+
+	return 1;
 }
 
 sub delete {
@@ -122,6 +124,7 @@
 	return undef unless defined $user and $user->get_status == Vhffs::Constants::WAITING_FOR_MODIFICATION;
 	$user->set_status( Vhffs::Constants::ACTIVATED );
 	$user->commit;
+	return 1;
 }
 
 1;

Modified: trunk/vhffs-api/src/Vhffs/Robots/Web.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Robots/Web.pm	2012-02-25 18:48:38 UTC (rev 2058)
+++ trunk/vhffs-api/src/Vhffs/Robots/Web.pm	2012-02-25 21:14:33 UTC (rev 2059)
@@ -79,6 +79,7 @@
 	Vhffs::Robots::vhffs_log( $vhffs, 'Created web area '.$web->get_servername );
 	$web->set_status( Vhffs::Constants::ACTIVATED );	
 	$web->commit;
+	return 1;
 }
 
 sub delete {
@@ -128,6 +129,7 @@
 	return undef unless defined $web and $web->get_status == Vhffs::Constants::WAITING_FOR_MODIFICATION;
 	$web->set_status( Vhffs::Constants::ACTIVATED );
 	$web->commit;
+	return 1;
 }
 
 1;


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