Skip to content

Commit

Permalink
Implement Client class
Browse files Browse the repository at this point in the history
Install ceilometerclient (aodhclient does not exist yet):

* manifest
* unit tests
* acceptance tests
* example manifest

Change-Id: Ib644bd0896af71b5fd0379236c7650588fd407b2
  • Loading branch information
EmilienM committed Nov 3, 2015
1 parent 9510ce4 commit 78af0f0
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 0 deletions.
1 change: 1 addition & 0 deletions examples/aodh.pp
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@
auth_password => 'a_big_secret',
}
class { '::aodh::evaluator': }
class { '::aodh::client': }
22 changes: 22 additions & 0 deletions manifests/client.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#
# Installs the aodh python library.
#
# == parameters
# [*ensure*]
# ensure state for pachage.
#
class aodh::client (
$ensure = 'present'
) {

include ::aodh::params

# there is no aodhclient yet
package { 'python-ceilometerclient':
ensure => $ensure,
name => $::aodh::params::client_package_name,
tag => 'openstack',
}

}

2 changes: 2 additions & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
#
class aodh::params {

$client_package_name = 'python-ceilometerclient'

case $::osfamily {
'RedHat': {
$common_package_name = 'openstack-aodh-common'
Expand Down
1 change: 1 addition & 0 deletions spec/acceptance/aodh_wsgi_apache_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ class { '::aodh::auth':
auth_url => 'http://127.0.0.1:5000/v2.0',
auth_password => 'a_big_secret',
}
class { '::aodh::client': }
case $::osfamily {
'Debian': {
warning('aodh-evaluator cannot be run on ubuntu system, package is broken. See LP#1508463')
Expand Down
33 changes: 33 additions & 0 deletions spec/classes/aodh_client_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
require 'spec_helper'

describe 'aodh::client' do

shared_examples_for 'aodh client' do

it { is_expected.to contain_class('aodh::params') }

it 'installs aodh client package' do
is_expected.to contain_package('python-ceilometerclient').with(
:ensure => 'present',
:name => 'python-ceilometerclient',
:tag => 'openstack',
)
end
end

context 'on Debian platforms' do
let :facts do
{ :osfamily => 'Debian' }
end

it_configures 'aodh client'
end

context 'on RedHat platforms' do
let :facts do
{ :osfamily => 'RedHat' }
end

it_configures 'aodh client'
end
end

0 comments on commit 78af0f0

Please sign in to comment.