From 6c05509bccbf58d8c6e08ca746d2f350e5d342a4 Mon Sep 17 00:00:00 2001 From: Dan Prince Date: Fri, 12 Feb 2016 14:38:46 -0500 Subject: [PATCH] Add zaqar::transport::wsgi class This class helps manage zaqar transport settings for wsgi. Change-Id: I668ecc79f1684438beff620394711c6bb8f2cc34 --- manifests/transport/wsgi.pp | 21 +++++++++++++++++++++ spec/classes/zaqar_transport_wsgi_spec.rb | 23 +++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 manifests/transport/wsgi.pp create mode 100644 spec/classes/zaqar_transport_wsgi_spec.rb diff --git a/manifests/transport/wsgi.pp b/manifests/transport/wsgi.pp new file mode 100644 index 0000000..5e68daf --- /dev/null +++ b/manifests/transport/wsgi.pp @@ -0,0 +1,21 @@ +# == class: zaqar::transport::wsgi +# +# [*bind*] +# Address on which the self-hosting server will listen. +# Defaults to $::os_service_default. +# +# [*port*] +# Port on which the self-hosting server will listen. +# Defaults to $::os_service_default. +# +class zaqar::transport::wsgi( + $bind = $::os_service_default, + $port = $::os_service_default, +) { + + zaqar_config { + 'drivers:transport:wsgi/bind': value => $bind; + 'drivers:transport:wsgi/port': value => $port; + } + +} diff --git a/spec/classes/zaqar_transport_wsgi_spec.rb b/spec/classes/zaqar_transport_wsgi_spec.rb new file mode 100644 index 0000000..3b46f59 --- /dev/null +++ b/spec/classes/zaqar_transport_wsgi_spec.rb @@ -0,0 +1,23 @@ +require 'spec_helper' + +describe 'zaqar::transport::wsgi' do + + let :facts do + { :osfamily => 'RedHat' } + end + + describe 'with custom values' do + let :params do + { + :bind => '1', + :port => '2', + } + end + + it 'configures custom values' do + is_expected.to contain_zaqar_config('drivers:transport:wsgi/bind').with_value('1') + is_expected.to contain_zaqar_config('drivers:transport:wsgi/port').with_value('2') + end + end + +end