[ARVADOS] created: 1.3.0-941-g505fc33ba

Git user git at public.curoverse.com
Thu May 23 17:42:54 UTC 2019


        at  505fc33ba2c04462bcb7ae6a4d163c1163b97f1e (commit)


commit 505fc33ba2c04462bcb7ae6a4d163c1163b97f1e
Author: Tom Clegg <tclegg at veritasgenetics.com>
Date:   Thu May 23 13:42:37 2019 -0400

    15273: Use lowercase keys for database connection params.
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg at veritasgenetics.com>

diff --git a/lib/config/config.default.yml b/lib/config/config.default.yml
index 16d6c61b5..bd4c3521d 100644
--- a/lib/config/config.default.yml
+++ b/lib/config/config.default.yml
@@ -69,11 +69,11 @@ Clusters:
       Connection:
         # All parameters here are passed to the PG client library in a connection string;
         # see https://www.postgresql.org/docs/current/static/libpq-connect.html#LIBPQ-PARAMKEYWORDS
-        Host: ""
-        Port: ""
-        User: ""
-        Password: ""
-        DBName: ""
+        host: ""
+        port: ""
+        user: ""
+        password: ""
+        dbname: ""
     API:
       # Maximum size (in bytes) allowed for a single API request.  This
       # limit is published in the discovery document for use by clients.
diff --git a/lib/config/generated_config.go b/lib/config/generated_config.go
index 5ee62ee82..d51cb9935 100644
--- a/lib/config/generated_config.go
+++ b/lib/config/generated_config.go
@@ -75,11 +75,11 @@ Clusters:
       Connection:
         # All parameters here are passed to the PG client library in a connection string;
         # see https://www.postgresql.org/docs/current/static/libpq-connect.html#LIBPQ-PARAMKEYWORDS
-        Host: ""
-        Port: ""
-        User: ""
-        Password: ""
-        DBName: ""
+        host: ""
+        port: ""
+        user: ""
+        password: ""
+        dbname: ""
     API:
       # Maximum size (in bytes) allowed for a single API request.  This
       # limit is published in the discovery document for use by clients.
diff --git a/sdk/python/tests/run_test_server.py b/sdk/python/tests/run_test_server.py
index 79767c2fa..a36bbfc6f 100644
--- a/sdk/python/tests/run_test_server.py
+++ b/sdk/python/tests/run_test_server.py
@@ -418,10 +418,10 @@ Clusters:
     PostgreSQL:
       ConnectionPool: 32
       Connection:
-        Host: {}
-        DBName: {}
-        User: {}
-        Password: {}
+        host: {}
+        dbname: {}
+        user: {}
+        password: {}
     NodeProfiles:
       "*":
         "arvados-controller":
diff --git a/services/api/config/arvados_config.rb b/services/api/config/arvados_config.rb
index 8e4151a73..9ea36315f 100644
--- a/services/api/config/arvados_config.rb
+++ b/services/api/config/arvados_config.rb
@@ -171,13 +171,13 @@ arvcfg.declare_config "RemoteClusters.*.Proxy", Boolean, :remote_hosts_via_dns
 dbcfg = ConfigLoader.new
 
 dbcfg.declare_config "PostgreSQL.ConnectionPool", Integer, :pool
-dbcfg.declare_config "PostgreSQL.Connection.Host", String, :host
-dbcfg.declare_config "PostgreSQL.Connection.Port", String, :port
-dbcfg.declare_config "PostgreSQL.Connection.User", String, :username
-dbcfg.declare_config "PostgreSQL.Connection.Password", String, :password
-dbcfg.declare_config "PostgreSQL.Connection.DBName", String, :database
-dbcfg.declare_config "PostgreSQL.Connection.Template", String, :template
-dbcfg.declare_config "PostgreSQL.Connection.Encoding", String, :encoding
+dbcfg.declare_config "PostgreSQL.Connection.host", String, :host
+dbcfg.declare_config "PostgreSQL.Connection.port", String, :port
+dbcfg.declare_config "PostgreSQL.Connection.user", String, :username
+dbcfg.declare_config "PostgreSQL.Connection.password", String, :password
+dbcfg.declare_config "PostgreSQL.Connection.dbname", String, :database
+dbcfg.declare_config "PostgreSQL.Connection.template", String, :template
+dbcfg.declare_config "PostgreSQL.Connection.encoding", String, :encoding
 
 application_config = {}
 %w(application.default application).each do |cfgfile|
@@ -239,16 +239,16 @@ end
 # rails environments.
 #
 if ::Rails.env.to_s == "test" && db_config["test"].nil?
-  $arvados_config["PostgreSQL"]["Connection"]["DBName"] = "arvados_test"
+  $arvados_config["PostgreSQL"]["Connection"]["dbname"] = "arvados_test"
 end
 
-if $arvados_config["PostgreSQL"]["Connection"]["Password"].empty?
+if $arvados_config["PostgreSQL"]["Connection"]["password"].empty?
   raise "Database password is empty, PostgreSQL section is: #{$arvados_config["PostgreSQL"]}"
 end
 
-dbhost = $arvados_config["PostgreSQL"]["Connection"]["Host"]
-if $arvados_config["PostgreSQL"]["Connection"]["Post"] != 0
-  dbhost += ":#{$arvados_config["PostgreSQL"]["Connection"]["Post"]}"
+dbhost = $arvados_config["PostgreSQL"]["Connection"]["host"]
+if $arvados_config["PostgreSQL"]["Connection"]["port"] != 0
+  dbhost += ":#{$arvados_config["PostgreSQL"]["Connection"]["port"]}"
 end
 
 #
@@ -257,10 +257,10 @@ end
 # For config migration, we've previously populated the PostgreSQL
 # section of the config from database.yml
 #
-ENV["DATABASE_URL"] = "postgresql://#{$arvados_config["PostgreSQL"]["Connection"]["User"]}:"+
-                      "#{$arvados_config["PostgreSQL"]["Connection"]["Password"]}@"+
-                      "#{dbhost}/#{$arvados_config["PostgreSQL"]["Connection"]["DBName"]}?"+
-                      "template=#{$arvados_config["PostgreSQL"]["Connection"]["Template"]}&"+
+ENV["DATABASE_URL"] = "postgresql://#{$arvados_config["PostgreSQL"]["Connection"]["user"]}:"+
+                      "#{$arvados_config["PostgreSQL"]["Connection"]["password"]}@"+
+                      "#{dbhost}/#{$arvados_config["PostgreSQL"]["Connection"]["dbname"]}?"+
+                      "template=#{$arvados_config["PostgreSQL"]["Connection"]["template"]}&"+
                       "encoding=#{$arvados_config["PostgreSQL"]["Connection"]["client_encoding"]}&"+
                       "pool=#{$arvados_config["PostgreSQL"]["ConnectionPool"]}"
 

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list