Merge "Add watcher client install support"

This commit is contained in:
Jenkins 2017-08-11 08:22:37 +00:00 committed by Gerrit Code Review
commit ae4c0865bb
3 changed files with 61 additions and 0 deletions

24
manifests/client.pp Normal file
View File

@ -0,0 +1,24 @@
# == Class: watcher::client
#
# Installs the watcher python library.
#
# === Parameters:
#
# [*ensure*]
# (Optional) Ensure state for pachage.
# Defaults to 'present'.
#
class watcher::client (
$ensure = 'present'
) {
include ::watcher::deps
include ::watcher::params
package { 'python-watcherclient':
ensure => $ensure,
name => $::watcher::params::client_package_name,
tag => 'openstack',
}
}

View File

@ -12,6 +12,7 @@ class watcher::params {
$applier_service_name = 'openstack-watcher-applier'
$decision_engine_package_name = 'openstack-watcher-decision-engine'
$decision_engine_service_name = 'openstack-watcher-decision-engine'
$client_package_name = undef
}
'Debian': {
$api_service_name = 'watcher-api'
@ -21,6 +22,7 @@ class watcher::params {
$applier_service_name = 'watcher-applier'
$decision_engine_package_name = 'watcher-decision-engine'
$decision_engine_service_name = 'watcher-decision-engine'
$client_package_name = 'python-watcherclient'
}
default: {
fail("Unsupported osfamily: ${::osfamily} operatingsystem")

View File

@ -0,0 +1,35 @@
require 'spec_helper'
describe 'watcher::client' do
shared_examples_for 'watcher client' do
it { is_expected.to contain_class('watcher::deps') }
it { is_expected.to contain_class('watcher::params') }
it 'installs watcher client package' do
is_expected.to contain_package('python-watcherclient').with(
:ensure => 'present',
:name => platform_params[:client_package_name],
:tag => 'openstack',
)
end
end
on_supported_os({
:supported_os => OSDefaults.get_supported_os
}).each do |os,facts|
context "on #{os}" do
let (:facts) do
facts.merge!(OSDefaults.get_facts())
end
let :platform_params do
{ :client_package_name => 'python-watcherclient' }
end
it_behaves_like 'watcher client'
end
end
end