]> review.fuel-infra Code Review - puppet-modules/puppet-ceilometer.git/commitdiff
Add the dbsync file, it's not yet in the packages
authorFrançois Charlier <fcharlier@ploup.net>
Tue, 11 Dec 2012 17:14:37 +0000 (18:14 +0100)
committerFrançois Charlier <fcharlier@ploup.net>
Tue, 11 Dec 2012 17:14:37 +0000 (18:14 +0100)
files/dbsync [new file with mode: 0644]
manifests/db.pp

diff --git a/files/dbsync b/files/dbsync
new file mode 100644 (file)
index 0000000..0769e45
--- /dev/null
@@ -0,0 +1,27 @@
+#!/usr/bin/env python
+# -*- encoding: utf-8 -*-
+#
+# Author: John Tran <jhtran@att.com>
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+"""Run SQLAlchemy db migration.
+"""
+
+import sys
+from ceilometer import storage
+from ceilometer.storage import migration
+from ceilometer.openstack.common import cfg
+
+if __name__ == '__main__':
+    cfg.CONF(sys.argv[1:])
+    migration.db_sync()
index 7e94f8eba3e2c370f8a8adbce85a8019b8365733..a8f26f01b17cadd7082a74398caaf73ce0b9d6d2 100644 (file)
@@ -42,7 +42,16 @@ class ceilometer::db (
 
   Ceilometer_config['DEFAULT/database_connection'] ~> Exec['ceilometer-dbsync']
 
-  exec{ 'ceilometer-dbsync':
+  file { '/usr/bin/ceilometer-dbsync':
+    ensure => present,
+    source => 'puppet:///modules/ceilometer/dbsync',
+    owner  => 'root',
+    group  => 'root',
+    mode   => '0755',
+    before => Exec['ceilometer-dbsync']
+  }
+
+  exec { 'ceilometer-dbsync':
     command     => $::ceilometer::params::dbsync_command,
     user        => $::ceilometer::params::username,
     refreshonly => true,