Hello,

We had an issue on snapshot tags reported on satellite (bz#893068). While troubleshooting I see that it is likely a bug due to a typo in Sever.pm. Details below :

/etc/rhn/rhn.conf has :
# system snapshots enabled
enable_snapshots = 1

whereas under /usr/share/perl5/vendor_perl/RHN/DB/Server.pm it checks for enable_snapshot config value which doesn't exist (missing trailing s in config variable):

sub snapshot_server {
  my $class = shift;
my %params = validate(@_, {server_id => 1, reason => 1, transaction => 0});

  if (!PXT::Config->get('enable_snapshot')) {
      return;
  }


While creating the snapshot it checks the config value of enable_snapshot which does not exists in default config. Thus inspite of having enable_snapshots=1 in rhn.conf, still it returns without creating a snapshot.

Attached the proposed patch to correct the behavior. Appreciate your feedback/thoughts on it.

Regards,
Paresh
>From 178c31f4a232b0d8e036b14e722f195c59667303 Mon Sep 17 00:00:00 2001
From: Paresh Mutha <pmu...@redhat.com>
Date: Tue, 8 Jan 2013 19:46:40 +0530
Subject: [PATCH] Fixing enable_snapshot typo BZ#893068 on satellite
 Signed-off-by: Paresh Mutha <pmu...@redhat.com>

---
 web/modules/rhn/RHN/DB/Server.pm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/web/modules/rhn/RHN/DB/Server.pm b/web/modules/rhn/RHN/DB/Server.pm
index 57dc2c0..35c94f6 100644
--- a/web/modules/rhn/RHN/DB/Server.pm
+++ b/web/modules/rhn/RHN/DB/Server.pm
@@ -1261,7 +1261,7 @@ sub snapshot_server {
   my $class = shift;
   my %params = validate(@_, {server_id => 1, reason => 1, transaction => 0});
 
-  if (!PXT::Config->get('enable_snapshot')) {
+  if (!PXT::Config->get('enable_snapshots')) {
       return;
   }
 
@@ -1282,7 +1282,7 @@ sub snapshot_set {
   my $class = shift;
   my %params = validate(@_, {set_label => 1, user_id => 1, reason => 1, transaction => 0});
 
-  if (!PXT::Config->get('enable_snapshot')) {
+  if (!PXT::Config->get('enable_snapshots')) {
       return;
   }
 
-- 
1.7.11.7

_______________________________________________
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel

Reply via email to