Alexandros Kosiaris has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/120012

Change subject: OSM: Better checking for planet_osm existence
......................................................................

OSM: Better checking for planet_osm existence

Use psql's -d argument and avoid one extraneous grep this way. Also one
less column to ask for

Change-Id: I21d9026ac396c268419317bab93df80587b5b90f
---
M modules/osm/manifests/populatedb.pp
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/12/120012/1

diff --git a/modules/osm/manifests/populatedb.pp 
b/modules/osm/manifests/populatedb.pp
index 66e63e6..37541cb 100644
--- a/modules/osm/manifests/populatedb.pp
+++ b/modules/osm/manifests/populatedb.pp
@@ -21,8 +21,9 @@
     ) {
 
     # Check if our db tables exist
-    $tables_exist = "/usr/bin/psql --tuples-only -c \'SELECT 
table_catalog,table_name FROM information_schema.tables;\' | /bin/grep \'^ 
${name}\' | /bin/grep \'planet_osm\'"
+    $tables_exist = "/usr/bin/psql -d ${name} --tuples-only -c \'SELECT 
table_name FROM information_schema.tables;\' | /bin/grep \'planet_osm\'"
 
+    # Note. This is not needed anymore with osm2pgsql 0.81
     exec { "load_900913-${name}":
         command => "/usr/bin/psql -d ${name} -f 
/usr/share/osm2pgsql/osm2pgsql/900913.sql",
         user    => 'postgres',

-- 
To view, visit https://gerrit.wikimedia.org/r/120012
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I21d9026ac396c268419317bab93df80587b5b90f
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Alexandros Kosiaris <akosia...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to