-- 
Dimitar Yordanov
Systems Management QA
#satellite-qa
From c4ae573a967d056a6915e007e4b220e754dc82fc Mon Sep 17 00:00:00 2001
From: Dimitar Yordanov <dyord...@redhat.com>
Date: Tue, 4 Feb 2014 20:49:01 +0100
Subject: [PATCH] 460556 - option clear-db missing in answer file

---
 spacewalk/setup/lib/Spacewalk/Setup.pm | 42 +++++++++++++++++-----------------
 1 file changed, 21 insertions(+), 21 deletions(-)

diff --git a/spacewalk/setup/lib/Spacewalk/Setup.pm b/spacewalk/setup/lib/Spacewalk/Setup.pm
index 32d3e74..0bfef35 100644
--- a/spacewalk/setup/lib/Spacewalk/Setup.pm
+++ b/spacewalk/setup/lib/Spacewalk/Setup.pm
@@ -36,7 +36,7 @@ our $VERSION = '1.1';
 
 use constant SHARED_DIR => "/usr/share/spacewalk/setup";
 
-use constant POSTGRESQL_SCHEMA_FILE => File::Spec->catfile("/etc", "sysconfig", 
+use constant POSTGRESQL_SCHEMA_FILE => File::Spec->catfile("/etc", "sysconfig",
     'rhn', 'postgres', 'main.sql');
 
 use constant POSTGRESQL_DEPLOY_FILE => File::Spec->catfile("/etc", "sysconfig",
@@ -376,23 +376,23 @@ sub upgrade_stop_services {
 
 my $spinning_callback_count;
 my @spinning_pattern = split /\n/, <<EOF;
-.               
- .              
-  o             
-   @            
-   (O)          
-    (*)         
-   ((%%))       
-    (( # ))     
-   ( ( # ) )    
- (  (  #  )  )  
-    (  !  )     
-       :        
-       .        
-       _        
-      . .       
-    .     .     
-                
+.
+ .
+  o
+   @
+   (O)
+    (*)
+   ((%%))
+    (( # ))
+   ( ( # ) )
+ (  (  #  )  )
+    (  !  )
+       :
+       .
+       _
+      . .
+    .     .
+
 EOF
 
 my $spinning_pattern_maxlength = 0;
@@ -1076,7 +1076,7 @@ sub postgresql_populate_db {
         return 1;
     }
 
-    if ($opts->{"clear-db"}) {
+    if ($opts->{"clear-db"} or ($answers->{"clear-db"} =~ /Y/i)) {
         print Spacewalk::Setup::loc("** Database: --clear-db option used.  Clearing database.\n");
         my $dbh = get_dbh($answers);
         postgresql_clear_db($dbh);
@@ -1143,7 +1143,7 @@ sub postgresql_test_db_schema {
     return $row ? 1 : 0;
 }
 
-# Clear the PostgreSQL schema by deleting the 'public' schema with cascade, 
+# Clear the PostgreSQL schema by deleting the 'public' schema with cascade,
 # then re-creating it. Also delete all the other known schemas that
 # Spacewalk might have created.
 
@@ -1604,7 +1604,7 @@ sub oracle_populate_db {
 
     oracle_populate_tablespace_name($tablespace_name);
 
-    if ($opts->{"clear-db"}) {
+    if ($opts->{"clear-db"} or ($answers->{"clear-db"} =~ /Y/i)) {
         print loc("** Database: --clear-db option used.  Clearing database.\n");
         clear_db($answers);
     }
-- 
1.8.3.1

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

Reply via email to