Merge "Remove memcached configuration from swift task"
This commit is contained in:
commit
296050759a
@ -27,7 +27,6 @@ class openstack::swift::proxy (
|
||||
$ratelimit_account_ratelimit = 0,
|
||||
$package_ensure = 'present',
|
||||
$controller_node_address = '10.0.0.1',
|
||||
$memcached = true,
|
||||
$swift_proxies = {
|
||||
'127.0.0.1' => '127.0.0.1'
|
||||
}
|
||||
@ -60,9 +59,7 @@ class openstack::swift::proxy (
|
||||
$log_level = 'WARNING'
|
||||
}
|
||||
|
||||
if $memcached and !defined(Class['memcached']) {
|
||||
class { 'memcached': }
|
||||
}
|
||||
#FIXME(bogdando) the memcached class must be included in catalog if swift node is a standalone!
|
||||
|
||||
if $ceilometer {
|
||||
$new_proxy_pipeline = split(
|
||||
@ -93,7 +90,7 @@ class openstack::swift::proxy (
|
||||
class { ['::swift::proxy::catch_errors', '::swift::proxy::healthcheck', '::swift::proxy::swift3',]:
|
||||
}
|
||||
|
||||
$cache_addresses = inline_template("<%= @swift_proxies.keys.uniq.sort.collect {|ip| ip + ':11211' }.join ',' %>")
|
||||
$cache_addresses = inline_template("<%= @swift_proxies.values.uniq.sort.collect {|ip| ip + ':11211' }.join ',' %>")
|
||||
|
||||
class { '::swift::proxy::cache': memcache_servers => split($cache_addresses, ',') }
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
require 'hiera'
|
||||
require 'test/unit'
|
||||
require 'socket'
|
||||
require 'timeout'
|
||||
|
||||
def hiera
|
||||
return $hiera if $hiera
|
||||
@ -12,6 +13,11 @@ def internal_address
|
||||
$internal_address = hiera.lookup 'internal_address', nil, {}
|
||||
end
|
||||
|
||||
def public_address
|
||||
return $public_address if $public_address
|
||||
$public_address = hiera.lookup 'public_address', nil, {}
|
||||
end
|
||||
|
||||
def process_tree
|
||||
return $process_tree if $process_tree
|
||||
$process_tree = {}
|
||||
@ -48,10 +54,12 @@ end
|
||||
|
||||
def test_connection(host, port)
|
||||
begin
|
||||
s = TCPSocket.open(host, port)
|
||||
s.close
|
||||
Timeout::timeout( 3 ) do
|
||||
s = TCPSocket.open(host, port)
|
||||
s.close
|
||||
end
|
||||
rescue
|
||||
return false
|
||||
raise Errno::ECONNREFUSED
|
||||
end
|
||||
true
|
||||
end
|
||||
@ -60,6 +68,10 @@ def memcached_backend_online?
|
||||
test_connection(internal_address, '11211')
|
||||
end
|
||||
|
||||
def memcached_backend_listen_public?
|
||||
test_connection(public_address, '11211')
|
||||
end
|
||||
|
||||
PROCESSES = %w(
|
||||
memcached
|
||||
)
|
||||
@ -75,7 +87,15 @@ class MemcachedPostTest < Test::Unit::TestCase
|
||||
end
|
||||
|
||||
def test_memcached_backend_online
|
||||
assert memcached_backend_online?, 'Can not connect to memcached on this host!'
|
||||
assert_nothing_raised do
|
||||
assert memcached_backend_online?, 'Can not connect to memcached on this host!'
|
||||
end
|
||||
end
|
||||
|
||||
def test_memcached_backend_dont_listen_public
|
||||
assert_raise Errno::ECONNREFUSED do
|
||||
memcached_backend_listen_public?
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -52,7 +52,7 @@ if !($storage_hash['images_ceph'] and $storage_hash['objects_ceph']) and !$stora
|
||||
|
||||
class { 'openstack::swift::proxy':
|
||||
swift_user_password => $swift_hash[user_password],
|
||||
swift_proxies => $controller_internal_addresses,
|
||||
swift_proxies => hiera('controller_internal_addresses'),
|
||||
ring_part_power => $ring_part_power,
|
||||
primary_proxy => $primary_proxy,
|
||||
controller_node_address => $management_vip,
|
||||
|
Loading…
Reference in New Issue
Block a user