ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smoha...@apache.org
Subject ambari git commit: AMBARI-11805. Ambari server start fails due to incorrect jdbc url when using sid (Ivan Kozlov via smohanty)
Date Mon, 08 Jun 2015 23:08:58 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 49fa52150 -> 181699d2f


AMBARI-11805. Ambari server start fails due to incorrect jdbc url when using sid (Ivan Kozlov
via smohanty)


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

Branch: refs/heads/trunk
Commit: 181699d2ff6e485e5d27552cf4e22b9e8d419225
Parents: 49fa521
Author: Sumit Mohanty <smohanty@hortonworks.com>
Authored: Mon Jun 8 16:06:54 2015 -0700
Committer: Sumit Mohanty <smohanty@hortonworks.com>
Committed: Mon Jun 8 16:07:20 2015 -0700

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


http://git-wip-us.apache.org/repos/asf/ambari/blob/181699d2/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 e85454b..25958eb 100644
--- a/ambari-server/src/main/python/ambari_server/dbConfiguration_linux.py
+++ b/ambari-server/src/main/python/ambari_server/dbConfiguration_linux.py
@@ -75,7 +75,7 @@ class LinuxDBMSConfig(DBMSConfig):
     self.database_url_pattern_alt = ""
 
     self.database_storage_name = ""
-    self.sid_or_sname = "sname"
+    self.sid_or_sname = "sid"
 
     self.init_script_file = ""
     self.drop_tables_script_file = ""
@@ -277,7 +277,7 @@ class LinuxDBMSConfig(DBMSConfig):
       properties.process_pair(JDBC_PROPERTIES_PREFIX + pair[0], pair[1])
 
     properties.process_pair(JDBC_RCA_DRIVER_PROPERTY, self.driver_class_name)
-    properties.process_pair(JDBC_RCA_URL_PROPERTY, self.database_url_pattern.format(jdbc_hostname,
self.database_port, self.database_name))
+    properties.process_pair(JDBC_RCA_URL_PROPERTY, connectionStringFormat.format(jdbc_hostname,
self.database_port, self.database_name))
     properties.process_pair(JDBC_RCA_USER_NAME_PROPERTY, self.database_username)
 
     self._store_password_property(properties, JDBC_RCA_PASSWORD_FILE_PROPERTY)
@@ -717,7 +717,7 @@ class OracleConfig(LinuxDBMSConfig):
     if (hasattr(options, 'sid_or_sname') and options.sid_or_sname == "sname") or \
         (hasattr(options, 'jdbc_url') and options.jdbc_url and re.match(ORACLE_SNAME_PATTERN,
options.jdbc_url)):
       print_info_msg("using SERVICE_NAME instead of SID for Oracle")
-      self.sid_or_sname = "service_name"
+      self.sid_or_sname = "sname"
 
     self.database_port = DBMSConfig._init_member_with_prop_default(options, "database_port",
                                                                    properties, JDBC_PORT_PROPERTY,
"1521")
@@ -763,7 +763,9 @@ class OracleConfig(LinuxDBMSConfig):
           False
       )
 
-      if idType == "2":
+      if idType == "1":
+        self.sid_or_sname = "sname"
+      elif idType == "2":
         self.sid_or_sname = "sid"
 
       IDTYPE_INDEX = int(idType) - 1

http://git-wip-us.apache.org/repos/asf/ambari/blob/181699d2/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 38a4367..0fc6a3f 100644
--- a/ambari-server/src/test/python/TestAmbariServer.py
+++ b/ambari-server/src/test/python/TestAmbariServer.py
@@ -2446,6 +2446,7 @@ MIIFHjCCAwYCCQDpHKOBI+Lt0zANBgkqhkiG9w0BAQUFADBRMQswCQYDVQQGEwJV
     self.assertEqual(dbmsConfig.database_name, "ambari")
     self.assertEqual(dbmsConfig.database_username, "ambari")
     self.assertEqual(dbmsConfig.database_password, "bigdata")
+    self.assertEqual(dbmsConfig.sid_or_sname, "sid")
 
     dbmsConfig.configure_database(props)
 
@@ -2564,7 +2565,7 @@ MIIFHjCCAwYCCQDpHKOBI+Lt0zANBgkqhkiG9w0BAQUFADBRMQswCQYDVQQGEwJV
 
     self.assertEqual(dbmsConfig.database_username, "ambari-server")
     self.assertEqual(dbmsConfig.database_password, "password")
-    self.assertEqual(dbmsConfig.sid_or_sname, "sname")
+    self.assertEqual(dbmsConfig.sid_or_sname, "sid")
     pass
 
   @not_for_platform(PLATFORM_WINDOWS)


Mime
View raw message