[pve-devel] [PATCH common 1/4] restenv: remove unnecessary if

Thomas Lamprecht t.lamprecht at proxmox.com
Tue Jul 25 15:32:20 CEST 2017


we return early from this function if the $rest_env singleton doesn't
evaluates to true yet, so this check is useless here.

Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---
 src/PVE/RESTEnvironment.pm | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/PVE/RESTEnvironment.pm b/src/PVE/RESTEnvironment.pm
index c528e61..2aee8de 100644
--- a/src/PVE/RESTEnvironment.pm
+++ b/src/PVE/RESTEnvironment.pm
@@ -60,8 +60,7 @@ my $log_task_result = sub {
 	$msg = $task->{status};
     }
 
-    $rest_env->log_cluster_msg($pri, $user, "end task $upid $msg")
-	if $rest_env;
+    $rest_env->log_cluster_msg($pri, $user, "end task $upid $msg");
 };
 
 my $worker_reaper = sub {
-- 
2.11.0





More information about the pve-devel mailing list