Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 3c8b52b11 -> 8df64c479


AMBARI-15298 Setup of Ambari DB for postgres says to use wrong .sql script 
(dsen)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/8df64c47
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/8df64c47
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/8df64c47

Branch: refs/heads/branch-2.2
Commit: 8df64c479baba6be65cea719d56c960792f07b51
Parents: 3c8b52b
Author: Dmytro Sen <[email protected]>
Authored: Fri Mar 4 16:04:45 2016 +0200
Committer: Dmytro Sen <[email protected]>
Committed: Fri Mar 4 16:04:45 2016 +0200

----------------------------------------------------------------------
 ambari-server/src/main/python/ambari-server.py            |  8 ++------
 .../main/python/ambari_server/dbConfiguration_linux.py    |  2 +-
 ambari-server/src/test/python/TestAmbariServer.py         | 10 ++++++++++
 3 files changed, 13 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/8df64c47/ambari-server/src/main/python/ambari-server.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/python/ambari-server.py 
b/ambari-server/src/main/python/ambari-server.py
index 072dfae..2faaecd 100755
--- a/ambari-server/src/main/python/ambari-server.py
+++ b/ambari-server/src/main/python/ambari-server.py
@@ -321,13 +321,9 @@ def init_parser_options(parser):
 
 @OsFamilyFuncImpl(OsFamilyImpl.DEFAULT)
 def init_parser_options(parser):
-  parser.add_option('-f', '--init-script-file',
-                    default='/var/lib/ambari-server/'
-                            
'resources/Ambari-DDL-Postgres-EMBEDDED-CREATE.sql',
+  parser.add_option('-f', '--init-script-file', default=None,
                     help="File with setup script")
-  parser.add_option('-r', '--drop-script-file', default="/var/lib/"
-                                                        
"ambari-server/resources/"
-                                                        
"Ambari-DDL-Postgres-EMBEDDED-DROP.sql",
+  parser.add_option('-r', '--drop-script-file', default=None,
                     help="File with drop script")
   parser.add_option('-u', '--upgrade-script-file', default="/var/lib/"
                                                            
"ambari-server/resources/upgrade/ddl/"

http://git-wip-us.apache.org/repos/asf/ambari/blob/8df64c47/ambari-server/src/main/python/ambari_server/dbConfiguration_linux.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/python/ambari_server/dbConfiguration_linux.py 
b/ambari-server/src/main/python/ambari_server/dbConfiguration_linux.py
index e8d292a..8b1cc0e 100644
--- a/ambari-server/src/main/python/ambari_server/dbConfiguration_linux.py
+++ b/ambari-server/src/main/python/ambari_server/dbConfiguration_linux.py
@@ -616,7 +616,7 @@ class PGConfig(LinuxDBMSConfig):
   def _setup_db(self):
     #password access to ambari-server and mapred
     dbname = self.database_name
-    scriptFile = PGConfig.POSTGRES_EMBEDDED_INIT_FILE
+    scriptFile = self.init_script_file
     username = self.database_username
     password = self.database_password
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/8df64c47/ambari-server/src/test/python/TestAmbariServer.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/TestAmbariServer.py 
b/ambari-server/src/test/python/TestAmbariServer.py
index 79593a9..a1b9cac 100644
--- a/ambari-server/src/test/python/TestAmbariServer.py
+++ b/ambari-server/src/test/python/TestAmbariServer.py
@@ -839,6 +839,8 @@ class TestAmbariServer(TestCase):
     del args.database_name
     del args.database_username
     del args.database_password
+    del args.init_script_file
+    del args.drop_script_file
 
     properties = Properties()
     properties.process_pair(JDBC_PASSWORD_PROPERTY, 
get_alias_string("mypwdalias"))
@@ -868,6 +870,8 @@ class TestAmbariServer(TestCase):
     del args.database_name
     del args.database_username
     del args.database_password
+    del args.init_script_file
+    del args.drop_script_file
 
     properties = Properties()
 
@@ -896,6 +900,8 @@ class TestAmbariServer(TestCase):
     del args.database_name
     del args.database_username
     del args.database_password
+    del args.init_script_file
+    del args.drop_script_file
 
     properties = Properties()
 
@@ -2994,6 +3000,8 @@ 
MIIFHjCCAwYCCQDpHKOBI+Lt0zANBgkqhkiG9w0BAQUFADBRMQswCQYDVQQGEwJV
       del args.persistence_type
       del args.sid_or_sname
       del args.jdbc_url
+      del args.init_script_file
+      del args.drop_script_file
 
       args.jdbc_driver= None
       args.jdbc_db = None
@@ -3284,6 +3292,8 @@ 
MIIFHjCCAwYCCQDpHKOBI+Lt0zANBgkqhkiG9w0BAQUFADBRMQswCQYDVQQGEwJV
     del args.database_username
     del args.database_password
     del args.persistence_type
+    del args.init_script_file
+    del args.drop_script_file
 
     set_silent(True)
 

Reply via email to