Upgrade to Havana release
Also upgrade gems: - berkshelf, ~> 2.0.10 - chefspec, ~> 3.0.2 - foodcritic, ~> 3.0.3 And update the DEPRECATION keywords Change-Id: Ic99817a08e7f8d006a9c7b57dc4ba42bf71d3a1c
This commit is contained in:
@@ -9,28 +9,28 @@
|
|||||||
"ref": "f759cd013c0a836f2acb219b3e006ff0a1308878"
|
"ref": "f759cd013c0a836f2acb219b3e006ff0a1308878"
|
||||||
},
|
},
|
||||||
"memcached": {
|
"memcached": {
|
||||||
"locked_version": "1.6.2"
|
"locked_version": "1.6.4"
|
||||||
},
|
},
|
||||||
"runit": {
|
"runit": {
|
||||||
"locked_version": "1.3.0"
|
"locked_version": "1.4.0"
|
||||||
},
|
},
|
||||||
"build-essential": {
|
"build-essential": {
|
||||||
"locked_version": "1.4.2"
|
"locked_version": "1.4.2"
|
||||||
},
|
},
|
||||||
"yum": {
|
"yum": {
|
||||||
"locked_version": "2.4.0"
|
"locked_version": "2.4.4"
|
||||||
},
|
},
|
||||||
"sysctl": {
|
"sysctl": {
|
||||||
"locked_version": "0.3.3"
|
"locked_version": "0.3.5"
|
||||||
},
|
},
|
||||||
"apt": {
|
"apt": {
|
||||||
"locked_version": "2.3.0"
|
"locked_version": "2.3.0"
|
||||||
},
|
},
|
||||||
"git": {
|
"git": {
|
||||||
"locked_version": "2.7.0"
|
"locked_version": "2.8.1"
|
||||||
},
|
},
|
||||||
"dmg": {
|
"dmg": {
|
||||||
"locked_version": "2.0.4"
|
"locked_version": "2.0.8"
|
||||||
},
|
},
|
||||||
"windows": {
|
"windows": {
|
||||||
"locked_version": "1.11.0"
|
"locked_version": "1.11.0"
|
||||||
|
|||||||
@@ -2,6 +2,10 @@
|
|||||||
|
|
||||||
This file is used to list changes made in each version of cookbook-openstack-object-storage.
|
This file is used to list changes made in each version of cookbook-openstack-object-storage.
|
||||||
|
|
||||||
|
## 8.0.0
|
||||||
|
### New version
|
||||||
|
* Upgrade to upstream Havana release
|
||||||
|
|
||||||
## 7.1.0:
|
## 7.1.0:
|
||||||
* Update apt sources to grizzly to prepare for grizzly
|
* Update apt sources to grizzly to prepare for grizzly
|
||||||
and havana branches
|
and havana branches
|
||||||
|
|||||||
6
Gemfile
6
Gemfile
@@ -2,8 +2,8 @@ source "https://rubygems.org"
|
|||||||
|
|
||||||
gem "chef", "~> 11.4.4"
|
gem "chef", "~> 11.4.4"
|
||||||
gem "json", "<= 1.7.7" # chef 11 dependency
|
gem "json", "<= 1.7.7" # chef 11 dependency
|
||||||
gem "berkshelf", "~> 2.0.8"
|
gem "berkshelf", "~> 2.0.10"
|
||||||
gem "chefspec", "~> 1.3.0"
|
gem "chefspec", "~> 3.0.2"
|
||||||
gem "foodcritic"
|
gem "foodcritic", "~> 3.0.3"
|
||||||
gem "strainer"
|
gem "strainer"
|
||||||
gem "webmock", "~> 1.11.0"
|
gem "webmock", "~> 1.11.0"
|
||||||
|
|||||||
103
Gemfile.lock
103
Gemfile.lock
@@ -1,30 +1,34 @@
|
|||||||
GEM
|
GEM
|
||||||
remote: https://rubygems.org/
|
remote: https://rubygems.org/
|
||||||
specs:
|
specs:
|
||||||
activesupport (3.2.14)
|
activesupport (3.2.16)
|
||||||
i18n (~> 0.6, >= 0.6.4)
|
i18n (~> 0.6, >= 0.6.4)
|
||||||
multi_json (~> 1.0)
|
multi_json (~> 1.0)
|
||||||
addressable (2.3.5)
|
addressable (2.3.5)
|
||||||
akami (1.2.0)
|
akami (1.2.0)
|
||||||
gyoku (>= 0.4.0)
|
gyoku (>= 0.4.0)
|
||||||
nokogiri (>= 1.4.0)
|
nokogiri (>= 1.4.0)
|
||||||
berkshelf (2.0.8)
|
berkshelf (2.0.10)
|
||||||
activesupport (~> 3.2.0)
|
activesupport (~> 3.2.0)
|
||||||
addressable (~> 2.3.4)
|
addressable (~> 2.3.4)
|
||||||
buff-shell_out (~> 0.1)
|
buff-shell_out (~> 0.1)
|
||||||
celluloid (>= 0.14.0)
|
|
||||||
chozo (>= 0.6.1)
|
chozo (>= 0.6.1)
|
||||||
faraday (>= 0.8.5)
|
faraday (>= 0.8.5)
|
||||||
hashie (>= 2.0.2)
|
hashie (>= 2.0.2)
|
||||||
minitar (~> 0.5.4)
|
minitar (~> 0.5.4)
|
||||||
rbzip2 (~> 0.2.0)
|
rbzip2 (~> 0.2.0)
|
||||||
retryable (~> 1.3.3)
|
retryable (~> 1.3.3)
|
||||||
ridley (~> 1.2.1)
|
ridley (~> 1.5.0)
|
||||||
solve (>= 0.5.0)
|
solve (>= 0.5.0)
|
||||||
thor (~> 0.18.0)
|
thor (~> 0.18.0)
|
||||||
|
buff-config (0.4.0)
|
||||||
|
buff-extensions (~> 0.3)
|
||||||
|
varia_model (~> 0.1)
|
||||||
buff-extensions (0.5.0)
|
buff-extensions (0.5.0)
|
||||||
|
buff-ignore (1.1.1)
|
||||||
|
buff-platform (0.1.0)
|
||||||
buff-ruby_engine (0.1.0)
|
buff-ruby_engine (0.1.0)
|
||||||
buff-shell_out (0.1.0)
|
buff-shell_out (0.1.1)
|
||||||
buff-ruby_engine (~> 0.1.0)
|
buff-ruby_engine (~> 0.1.0)
|
||||||
builder (3.2.2)
|
builder (3.2.2)
|
||||||
celluloid (0.14.1)
|
celluloid (0.14.1)
|
||||||
@@ -46,33 +50,29 @@ GEM
|
|||||||
ohai (>= 0.6.0)
|
ohai (>= 0.6.0)
|
||||||
rest-client (>= 1.0.4, < 1.7.0)
|
rest-client (>= 1.0.4, < 1.7.0)
|
||||||
yajl-ruby (~> 1.1)
|
yajl-ruby (~> 1.1)
|
||||||
chefspec (1.3.1)
|
chefspec (3.0.2)
|
||||||
chef (>= 10.0)
|
chef (~> 11.0)
|
||||||
erubis
|
fauxhai (~> 2.0)
|
||||||
fauxhai (>= 0.1.1, < 2.0)
|
rspec (~> 2.14)
|
||||||
minitest-chef-handler (>= 0.6.0)
|
|
||||||
rspec (~> 2.0)
|
|
||||||
chozo (0.6.1)
|
chozo (0.6.1)
|
||||||
activesupport (>= 3.2.0)
|
activesupport (>= 3.2.0)
|
||||||
hashie (>= 2.0.2)
|
hashie (>= 2.0.2)
|
||||||
multi_json (>= 1.3.0)
|
multi_json (>= 1.3.0)
|
||||||
ci_reporter (1.9.0)
|
|
||||||
builder (>= 2.1.2)
|
|
||||||
crack (0.4.1)
|
crack (0.4.1)
|
||||||
safe_yaml (~> 0.9.0)
|
safe_yaml (~> 0.9.0)
|
||||||
diff-lcs (1.2.4)
|
diff-lcs (1.2.5)
|
||||||
erubis (2.7.0)
|
erubis (2.7.0)
|
||||||
faraday (0.8.8)
|
faraday (0.8.8)
|
||||||
multipart-post (~> 1.2.0)
|
multipart-post (~> 1.2.0)
|
||||||
fauxhai (1.1.1)
|
fauxhai (2.0.1)
|
||||||
httparty
|
|
||||||
net-ssh
|
net-ssh
|
||||||
ohai
|
ohai
|
||||||
ffi (1.9.0)
|
ffi (1.9.3)
|
||||||
foodcritic (2.2.0)
|
foodcritic (3.0.3)
|
||||||
erubis
|
erubis
|
||||||
gherkin (~> 2.11.7)
|
gherkin (~> 2.11.7)
|
||||||
nokogiri (~> 1.5.4)
|
nokogiri (~> 1.5.4)
|
||||||
|
rake
|
||||||
treetop (~> 1.4.10)
|
treetop (~> 1.4.10)
|
||||||
yajl-ruby (~> 1.1.0)
|
yajl-ruby (~> 1.1.0)
|
||||||
gherkin (2.11.8)
|
gherkin (2.11.8)
|
||||||
@@ -82,37 +82,29 @@ GEM
|
|||||||
gyoku (1.1.0)
|
gyoku (1.1.0)
|
||||||
builder (>= 2.1.2)
|
builder (>= 2.1.2)
|
||||||
hashie (2.0.5)
|
hashie (2.0.5)
|
||||||
highline (1.6.19)
|
highline (1.6.20)
|
||||||
httparty (0.11.0)
|
httpclient (2.3.4.1)
|
||||||
multi_json (~> 1.0)
|
|
||||||
multi_xml (>= 0.5.2)
|
|
||||||
httpclient (2.2.0.2)
|
|
||||||
httpi (0.9.7)
|
httpi (0.9.7)
|
||||||
rack
|
rack
|
||||||
i18n (0.6.5)
|
i18n (0.6.9)
|
||||||
ipaddress (0.8.0)
|
ipaddress (0.8.0)
|
||||||
json (1.7.7)
|
json (1.7.7)
|
||||||
little-plugger (1.1.3)
|
little-plugger (1.1.3)
|
||||||
logging (1.6.2)
|
logging (1.8.1)
|
||||||
little-plugger (>= 1.1.3)
|
little-plugger (>= 1.1.3)
|
||||||
mime-types (1.24)
|
multi_json (>= 1.3.6)
|
||||||
|
mime-types (2.0)
|
||||||
minitar (0.5.4)
|
minitar (0.5.4)
|
||||||
minitest (4.7.5)
|
|
||||||
minitest-chef-handler (1.0.1)
|
|
||||||
chef
|
|
||||||
ci_reporter
|
|
||||||
minitest (~> 4.7.3)
|
|
||||||
mixlib-authentication (1.3.0)
|
mixlib-authentication (1.3.0)
|
||||||
mixlib-log
|
mixlib-log
|
||||||
mixlib-cli (1.3.0)
|
mixlib-cli (1.3.0)
|
||||||
mixlib-config (1.1.2)
|
mixlib-config (2.1.0)
|
||||||
mixlib-log (1.6.0)
|
mixlib-log (1.6.0)
|
||||||
mixlib-shellout (1.2.0)
|
mixlib-shellout (1.3.0)
|
||||||
multi_json (1.7.9)
|
multi_json (1.8.2)
|
||||||
multi_xml (0.5.5)
|
|
||||||
multipart-post (1.2.0)
|
multipart-post (1.2.0)
|
||||||
net-http-persistent (2.9)
|
net-http-persistent (2.9)
|
||||||
net-ssh (2.6.8)
|
net-ssh (2.7.0)
|
||||||
net-ssh-gateway (1.2.0)
|
net-ssh-gateway (1.2.0)
|
||||||
net-ssh (>= 2.6.5)
|
net-ssh (>= 2.6.5)
|
||||||
net-ssh-multi (1.1)
|
net-ssh-multi (1.1)
|
||||||
@@ -121,23 +113,26 @@ GEM
|
|||||||
nio4r (0.5.0)
|
nio4r (0.5.0)
|
||||||
nokogiri (1.5.10)
|
nokogiri (1.5.10)
|
||||||
nori (1.1.5)
|
nori (1.1.5)
|
||||||
ohai (6.18.0)
|
ohai (6.20.0)
|
||||||
ipaddress
|
ipaddress
|
||||||
mixlib-cli
|
mixlib-cli
|
||||||
mixlib-config
|
mixlib-config
|
||||||
mixlib-log
|
mixlib-log
|
||||||
mixlib-shellout
|
mixlib-shellout
|
||||||
systemu
|
systemu (~> 2.5.2)
|
||||||
yajl-ruby
|
yajl-ruby
|
||||||
polyglot (0.3.3)
|
polyglot (0.3.3)
|
||||||
rack (1.5.2)
|
rack (1.5.2)
|
||||||
|
rake (10.1.0)
|
||||||
rbzip2 (0.2.0)
|
rbzip2 (0.2.0)
|
||||||
rest-client (1.6.7)
|
rest-client (1.6.7)
|
||||||
mime-types (>= 1.16)
|
mime-types (>= 1.16)
|
||||||
retryable (1.3.3)
|
retryable (1.3.3)
|
||||||
ridley (1.2.5)
|
ridley (1.5.3)
|
||||||
addressable
|
addressable
|
||||||
|
buff-config (~> 0.2)
|
||||||
buff-extensions (~> 0.3)
|
buff-extensions (~> 0.3)
|
||||||
|
buff-ignore (~> 1.1)
|
||||||
buff-shell_out (~> 0.1)
|
buff-shell_out (~> 0.1)
|
||||||
celluloid (~> 0.14.0)
|
celluloid (~> 0.14.0)
|
||||||
celluloid-io (~> 0.14.0)
|
celluloid-io (~> 0.14.0)
|
||||||
@@ -148,6 +143,7 @@ GEM
|
|||||||
mixlib-authentication (>= 1.3.0)
|
mixlib-authentication (>= 1.3.0)
|
||||||
net-http-persistent (>= 2.8)
|
net-http-persistent (>= 2.8)
|
||||||
net-ssh
|
net-ssh
|
||||||
|
nio4r (>= 0.5.0)
|
||||||
retryable
|
retryable
|
||||||
solve (>= 0.4.4)
|
solve (>= 0.4.4)
|
||||||
varia_model (~> 0.1)
|
varia_model (~> 0.1)
|
||||||
@@ -156,12 +152,12 @@ GEM
|
|||||||
rspec-core (~> 2.14.0)
|
rspec-core (~> 2.14.0)
|
||||||
rspec-expectations (~> 2.14.0)
|
rspec-expectations (~> 2.14.0)
|
||||||
rspec-mocks (~> 2.14.0)
|
rspec-mocks (~> 2.14.0)
|
||||||
rspec-core (2.14.5)
|
rspec-core (2.14.7)
|
||||||
rspec-expectations (2.14.2)
|
rspec-expectations (2.14.4)
|
||||||
diff-lcs (>= 1.1.3, < 2.0)
|
diff-lcs (>= 1.1.3, < 2.0)
|
||||||
rspec-mocks (2.14.3)
|
rspec-mocks (2.14.4)
|
||||||
rubyntlm (0.1.1)
|
rubyntlm (0.1.1)
|
||||||
safe_yaml (0.9.5)
|
safe_yaml (0.9.7)
|
||||||
savon (0.9.5)
|
savon (0.9.5)
|
||||||
akami (~> 1.0)
|
akami (~> 1.0)
|
||||||
builder (>= 2.1.2)
|
builder (>= 2.1.2)
|
||||||
@@ -170,13 +166,14 @@ GEM
|
|||||||
nokogiri (>= 1.4.0)
|
nokogiri (>= 1.4.0)
|
||||||
nori (~> 1.0)
|
nori (~> 1.0)
|
||||||
wasabi (~> 1.0)
|
wasabi (~> 1.0)
|
||||||
solve (0.8.0)
|
solve (0.8.2)
|
||||||
strainer (3.2.2)
|
strainer (3.3.0)
|
||||||
berkshelf (~> 2.0)
|
berkshelf (~> 2.0)
|
||||||
|
buff-platform (~> 0.1)
|
||||||
systemu (2.5.2)
|
systemu (2.5.2)
|
||||||
thor (0.18.1)
|
thor (0.18.1)
|
||||||
timers (1.1.0)
|
timers (1.1.0)
|
||||||
treetop (1.4.14)
|
treetop (1.4.15)
|
||||||
polyglot
|
polyglot
|
||||||
polyglot (>= 0.3.1)
|
polyglot (>= 0.3.1)
|
||||||
uuidtools (2.1.4)
|
uuidtools (2.1.4)
|
||||||
@@ -188,11 +185,11 @@ GEM
|
|||||||
webmock (1.11.0)
|
webmock (1.11.0)
|
||||||
addressable (>= 2.2.7)
|
addressable (>= 2.2.7)
|
||||||
crack (>= 0.3.2)
|
crack (>= 0.3.2)
|
||||||
winrm (1.1.2)
|
winrm (1.1.3)
|
||||||
gssapi (~> 1.0.0)
|
gssapi (~> 1.0.0)
|
||||||
httpclient (~> 2.2.0.2)
|
httpclient (~> 2.2, >= 2.2.0.2)
|
||||||
logging (~> 1.6.1)
|
logging (~> 1.6, >= 1.6.1)
|
||||||
nokogiri (~> 1.5.0)
|
nokogiri (~> 1.5)
|
||||||
rubyntlm (~> 0.1.1)
|
rubyntlm (~> 0.1.1)
|
||||||
savon (= 0.9.5)
|
savon (= 0.9.5)
|
||||||
uuidtools (~> 2.1.2)
|
uuidtools (~> 2.1.2)
|
||||||
@@ -202,10 +199,10 @@ PLATFORMS
|
|||||||
ruby
|
ruby
|
||||||
|
|
||||||
DEPENDENCIES
|
DEPENDENCIES
|
||||||
berkshelf (~> 2.0.8)
|
berkshelf (~> 2.0.10)
|
||||||
chef (~> 11.4.4)
|
chef (~> 11.4.4)
|
||||||
chefspec (~> 1.3.0)
|
chefspec (~> 3.0.2)
|
||||||
foodcritic
|
foodcritic (~> 3.0.3)
|
||||||
json (<= 1.7.7)
|
json (<= 1.7.7)
|
||||||
strainer
|
strainer
|
||||||
webmock (~> 1.11.0)
|
webmock (~> 1.11.0)
|
||||||
|
|||||||
12
README.md
12
README.md
@@ -256,13 +256,15 @@ License and Author
|
|||||||
|
|
||||||
| | |
|
| | |
|
||||||
|:---------------------|:---------------------------------------------------|
|
|:---------------------|:---------------------------------------------------|
|
||||||
| **Authors** | Alan Meadows (<alan.meadows@gmail.com>) |
|
| **Author** | Alan Meadows (<alan.meadows@gmail.com>) |
|
||||||
| | Oisin Feeley (<of3434@att.com>) |
|
| **Author** | Oisin Feeley (<of3434@att.com>) |
|
||||||
| | Ron Pedde (<ron.pedde@rackspace.com>) |
|
| **Author** | Ron Pedde (<ron.pedde@rackspace.com>) |
|
||||||
| | Will Kelly (<will.kelly@rackspace.com>) |
|
| **Author** | Will Kelly (<will.kelly@rackspace.com>) |
|
||||||
|
| **Author** | Chen Zhiwei (<zhiwchen@cn.ibm.com>) |
|
||||||
| | |
|
| | |
|
||||||
| **Copyright** | Copyright (c) 2013, AT&T, Inc. |
|
| **Copyright** | Copyright (c) 2013, AT&T, Inc. |
|
||||||
| | Copyright (c) 2012, Rackspace US, Inc. |
|
| **Copyright** | Copyright (c) 2012, Rackspace US, Inc. |
|
||||||
|
| **Copyright** | Copyright (c) 2013, IBM, Corp. |
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ default["swift"]["git_builder_ip"] = "127.0.0.1"
|
|||||||
|
|
||||||
# the release only has any effect on ubuntu, and must be
|
# the release only has any effect on ubuntu, and must be
|
||||||
# a valid release on http://ubuntu-cloud.archive.canonical.com/ubuntu
|
# a valid release on http://ubuntu-cloud.archive.canonical.com/ubuntu
|
||||||
default["swift"]["release"] = "grizzly"
|
default["swift"]["release"] = "havana"
|
||||||
|
|
||||||
# we support an optional secret databag where we will retrieve the
|
# we support an optional secret databag where we will retrieve the
|
||||||
# following attributes overriding any default attributes here
|
# following attributes overriding any default attributes here
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ maintainer "ATT, Inc."
|
|||||||
license "Apache 2.0"
|
license "Apache 2.0"
|
||||||
description "Installs and configures Openstack Swift"
|
description "Installs and configures Openstack Swift"
|
||||||
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
|
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
|
||||||
version "7.1.0"
|
version "8.0.0"
|
||||||
recipe "openstack-object-storage::setup", "Does initial setup of a swift cluster"
|
recipe "openstack-object-storage::setup", "Does initial setup of a swift cluster"
|
||||||
recipe "openstack-object-storage::account-server", "Installs the swift account server"
|
recipe "openstack-object-storage::account-server", "Installs the swift account server"
|
||||||
recipe "openstack-object-storage::object-server", "Installs the swift object server"
|
recipe "openstack-object-storage::object-server", "Installs the swift object server"
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ sample output
|
|||||||
/dev/sdb: 261 cylinders, 255 heads, 63 sectors/track
|
/dev/sdb: 261 cylinders, 255 heads, 63 sectors/track
|
||||||
=end
|
=end
|
||||||
def sfdisk_get_size(dev_name)
|
def sfdisk_get_size(dev_name)
|
||||||
out = %x{sfdisk #{dev_name} -s}
|
out = Mixlib::ShellOut.new("sfdisk #{dev_name} -s").run_command.stdout
|
||||||
Chef::Log.info("updating geo using sfdisk: #{out}")
|
Chef::Log.info("updating geo using sfdisk: #{out}")
|
||||||
|
|
||||||
# sfdisk sees the world as 1k blocks
|
# sfdisk sees the world as 1k blocks
|
||||||
@@ -123,6 +123,7 @@ end
|
|||||||
|
|
||||||
action :list do
|
action :list do
|
||||||
Chef::Log.info("at some point there'll be a list")
|
Chef::Log.info("at some point there'll be a list")
|
||||||
|
new_resource.updated_by_last_action(update)
|
||||||
end
|
end
|
||||||
|
|
||||||
####
|
####
|
||||||
@@ -247,12 +248,12 @@ action :ensure_exists do
|
|||||||
|
|
||||||
case params[:type]
|
case params[:type]
|
||||||
when "xfs"
|
when "xfs"
|
||||||
if not system("xfs_admin -l #{device}")
|
if not Mixlib::ShellOut.new("xfs_admin -l #{device}").run_command.status
|
||||||
Mixlib::ShellOut.new("mkfs.xfs -f -i size=512 #{device}").run_command
|
Mixlib::ShellOut.new("mkfs.xfs -f -i size=512 #{device}").run_command
|
||||||
update = true
|
update = true
|
||||||
end
|
end
|
||||||
when "ext4"
|
when "ext4"
|
||||||
if not system("tune2fs -l #{device} | grep \"Filesystem volume name:\" | awk \'{print $4}\' | grep -v \"<none>\"")
|
if not Mixlib::ShellOut.new("tune2fs -l #{device} | grep \"Filesystem volume name:\" | awk \'{print $4}\' | grep -v \"<none>\"").run_command.status
|
||||||
Mixlib::ShellOut.new("mkfs.ext4 #{device}").run_command
|
Mixlib::ShellOut.new("mkfs.ext4 #{device}").run_command
|
||||||
update = true
|
update = true
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -38,10 +38,10 @@ action :ensure_exists do
|
|||||||
info["device"] = device
|
info["device"] = device
|
||||||
info["ip"] = @new_resource.ip
|
info["ip"] = @new_resource.ip
|
||||||
info["format"] = @new_resource.format
|
info["format"] = @new_resource.format
|
||||||
info["uuid"] = `blkid /dev/#{device} -s UUID -o value`.strip
|
info["uuid"] = Mixlib::ShellOut.new("blkid /dev/#{device} -s UUID -o value").run_command.stdout.strip
|
||||||
info["mountpoint"] = info["uuid"].split("-").join("")
|
info["mountpoint"] = info["uuid"].split("-").join("")
|
||||||
info["mounted"] = system("mount | grep '#{path}/#{info["mountpoint"]}\'")
|
info["mounted"] = Mixlib::ShellOut.new("mount | grep '#{path}/#{info["mountpoint"]}\'").run_command.status
|
||||||
info["size"] = `sfdisk -s /dev/#{device}`.to_i / 1024
|
info["size"] = Mixlib::ShellOut.new("sfdisk -s /dev/#{device}").run_command.stdout.to_i / 1024
|
||||||
|
|
||||||
next if (info["uuid"] == '')
|
next if (info["uuid"] == '')
|
||||||
|
|
||||||
@@ -79,7 +79,7 @@ action :ensure_exists do
|
|||||||
# mounts in /srv/node that shouldn't be there
|
# mounts in /srv/node that shouldn't be there
|
||||||
(mounts.keys.select{|x| x and x[/^#{path}/]} - valid_mounts).each do |dev|
|
(mounts.keys.select{|x| x and x[/^#{path}/]} - valid_mounts).each do |dev|
|
||||||
Chef::Log.info("Unmounting #{dev}")
|
Chef::Log.info("Unmounting #{dev}")
|
||||||
system("umount #{dev}") if system("mount | grep '#{dev}'")
|
Mixlib::ShellOut.new("umount #{dev}").run_command if Mixlib::ShellOut.new("mount | grep '#{dev}'").run_command.status
|
||||||
new_resource.updated_by_last_action(true)
|
new_resource.updated_by_last_action(true)
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -148,7 +148,7 @@ action :ensure_exists do
|
|||||||
end
|
end
|
||||||
|
|
||||||
dev_info.reject { |k,v| v["mounted"] }.keys.each do |uuid|
|
dev_info.reject { |k,v| v["mounted"] }.keys.each do |uuid|
|
||||||
dev_info[uuid]["mounted"] = system("mount | grep '#{path}/#{dev_info[uuid]["mountpoint"]}\'")
|
dev_info[uuid]["mounted"] = Mixlib::ShellOut.new("mount | grep '#{path}/#{dev_info[uuid]["mountpoint"]}\'").run_command.status
|
||||||
end
|
end
|
||||||
|
|
||||||
if @new_resource.publish_attributes and dev_info != {}
|
if @new_resource.publish_attributes and dev_info != {}
|
||||||
|
|||||||
@@ -21,6 +21,7 @@
|
|||||||
|
|
||||||
class Chef::Recipe
|
class Chef::Recipe
|
||||||
include IPUtils
|
include IPUtils
|
||||||
|
include DriveUtils
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
require 'spec_helper'
|
require_relative 'spec_helper'
|
||||||
|
|
||||||
describe 'openstack-object-storage::account-server' do
|
describe 'openstack-object-storage::account-server' do
|
||||||
|
|
||||||
@@ -10,7 +10,7 @@ describe 'openstack-object-storage::account-server' do
|
|||||||
|
|
||||||
before do
|
before do
|
||||||
swift_stubs
|
swift_stubs
|
||||||
@chef_run = ::ChefSpec::ChefRunner.new ::UBUNTU_OPTS
|
@chef_run = ::ChefSpec::Runner.new ::UBUNTU_OPTS
|
||||||
@node = @chef_run.node
|
@node = @chef_run.node
|
||||||
@node.set['lsb']['code'] = 'precise'
|
@node.set['lsb']['code'] = 'precise'
|
||||||
@node.set['swift']['authmode'] = 'swauth'
|
@node.set['swift']['authmode'] = 'swauth'
|
||||||
@@ -38,7 +38,7 @@ describe 'openstack-object-storage::account-server' do
|
|||||||
|
|
||||||
it "starts swift account services on boot" do
|
it "starts swift account services on boot" do
|
||||||
%w{swift-account swift-account-auditor swift-account-reaper swift-account-replicator}.each do |svc|
|
%w{swift-account swift-account-auditor swift-account-reaper swift-account-replicator}.each do |svc|
|
||||||
expect(@chef_run).to set_service_to_start_on_boot svc
|
expect(@chef_run).to enable_service(svc)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -49,7 +49,8 @@ describe 'openstack-object-storage::account-server' do
|
|||||||
end
|
end
|
||||||
|
|
||||||
it "has proper owner" do
|
it "has proper owner" do
|
||||||
expect(@file).to be_owned_by "swift", "swift"
|
expect(@file.owner).to eq("swift")
|
||||||
|
expect(@file.group).to eq("swift")
|
||||||
end
|
end
|
||||||
|
|
||||||
it "has proper modes" do
|
it "has proper modes" do
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
require 'spec_helper'
|
require_relative 'spec_helper'
|
||||||
|
|
||||||
describe 'openstack-object-storage::common' do
|
describe 'openstack-object-storage::common' do
|
||||||
|
|
||||||
@@ -10,16 +10,16 @@ describe 'openstack-object-storage::common' do
|
|||||||
|
|
||||||
before do
|
before do
|
||||||
swift_stubs
|
swift_stubs
|
||||||
@chef_run = ::ChefSpec::ChefRunner.new ::UBUNTU_OPTS
|
@chef_run = ::ChefSpec::Runner.new ::UBUNTU_OPTS
|
||||||
@node = @chef_run.node
|
@node = @chef_run.node
|
||||||
@node.set['platform_family'] = "debian"
|
@node.set['platform_family'] = "debian"
|
||||||
@node.set['lsb']['codename'] = "precise"
|
@node.set['lsb']['codename'] = "precise"
|
||||||
@node.set['swift']['release'] = "grizzly"
|
@node.set['swift']['release'] = "havana"
|
||||||
@node.set['swift']['authmode'] = 'swauth'
|
@node.set['swift']['authmode'] = 'swauth'
|
||||||
@node.set['swift']['git_builder_ip'] = '10.0.0.10'
|
@node.set['swift']['git_builder_ip'] = '10.0.0.10'
|
||||||
|
|
||||||
# TODO: this does not work
|
# TODO: this does not work
|
||||||
# ::Chef::Log.should_receive(:info).with("chefspec: precise-updates/grizzly")
|
# ::Chef::Log.should_receive(:info).with("chefspec: precise-updates/havana")
|
||||||
|
|
||||||
@chef_run.converge "openstack-object-storage::common"
|
@chef_run.converge "openstack-object-storage::common"
|
||||||
end
|
end
|
||||||
@@ -41,7 +41,8 @@ describe 'openstack-object-storage::common' do
|
|||||||
end
|
end
|
||||||
|
|
||||||
it "has proper owner" do
|
it "has proper owner" do
|
||||||
expect(@file).to be_owned_by "swift", "swift"
|
expect(@file.owner).to eq("swift")
|
||||||
|
expect(@file.group).to eq("swift")
|
||||||
end
|
end
|
||||||
|
|
||||||
it "has proper modes" do
|
it "has proper modes" do
|
||||||
@@ -57,7 +58,8 @@ describe 'openstack-object-storage::common' do
|
|||||||
end
|
end
|
||||||
|
|
||||||
it "has proper owner" do
|
it "has proper owner" do
|
||||||
expect(@file).to be_owned_by "swift", "swift"
|
expect(@file.owner).to eq("swift")
|
||||||
|
expect(@file.group).to eq("swift")
|
||||||
end
|
end
|
||||||
|
|
||||||
it "has proper modes" do
|
it "has proper modes" do
|
||||||
@@ -73,7 +75,8 @@ describe 'openstack-object-storage::common' do
|
|||||||
end
|
end
|
||||||
|
|
||||||
it "has proper owner" do
|
it "has proper owner" do
|
||||||
expect(@file).to be_owned_by "swift", "swift"
|
expect(@file.owner).to eq("swift")
|
||||||
|
expect(@file.group).to eq("swift")
|
||||||
end
|
end
|
||||||
|
|
||||||
it "has proper modes" do
|
it "has proper modes" do
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
require 'spec_helper'
|
require_relative 'spec_helper'
|
||||||
|
|
||||||
describe 'openstack-object-storage::container-server' do
|
describe 'openstack-object-storage::container-server' do
|
||||||
|
|
||||||
@@ -10,7 +10,7 @@ describe 'openstack-object-storage::container-server' do
|
|||||||
|
|
||||||
before do
|
before do
|
||||||
swift_stubs
|
swift_stubs
|
||||||
@chef_run = ::ChefSpec::ChefRunner.new ::UBUNTU_OPTS
|
@chef_run = ::ChefSpec::Runner.new ::UBUNTU_OPTS
|
||||||
@node = @chef_run.node
|
@node = @chef_run.node
|
||||||
@node.set['lsb']['code'] = 'precise'
|
@node.set['lsb']['code'] = 'precise'
|
||||||
@node.set['swift']['authmode'] = 'swauth'
|
@node.set['swift']['authmode'] = 'swauth'
|
||||||
@@ -36,7 +36,7 @@ describe 'openstack-object-storage::container-server' do
|
|||||||
|
|
||||||
it "starts swift container services on boot" do
|
it "starts swift container services on boot" do
|
||||||
%w{swift-container swift-container-auditor swift-container-replicator swift-container-updater swift-container-sync}.each do |svc|
|
%w{swift-container swift-container-auditor swift-container-replicator swift-container-updater swift-container-sync}.each do |svc|
|
||||||
expect(@chef_run).to set_service_to_start_on_boot svc
|
expect(@chef_run).to enable_service(svc)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -47,7 +47,8 @@ describe 'openstack-object-storage::container-server' do
|
|||||||
end
|
end
|
||||||
|
|
||||||
it "has proper owner" do
|
it "has proper owner" do
|
||||||
expect(@file).to be_owned_by "swift", "swift"
|
expect(@file.owner).to eq("swift")
|
||||||
|
expect(@file.group).to eq("swift")
|
||||||
end
|
end
|
||||||
|
|
||||||
it "has proper modes" do
|
it "has proper modes" do
|
||||||
@@ -55,8 +56,7 @@ describe 'openstack-object-storage::container-server' do
|
|||||||
end
|
end
|
||||||
|
|
||||||
it "has allowed sync hosts" do
|
it "has allowed sync hosts" do
|
||||||
expect(@chef_run).to create_file_with_content @file.name,
|
expect(@chef_run).to render_file(@file.name).with_content("allowed_sync_hosts = host1,host2,host3")
|
||||||
"allowed_sync_hosts = host1,host2,host3"
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
@@ -79,8 +79,7 @@ describe 'openstack-object-storage::container-server' do
|
|||||||
end
|
end
|
||||||
|
|
||||||
it "has no allowed_sync_hosts on empty lists" do
|
it "has no allowed_sync_hosts on empty lists" do
|
||||||
expect(@chef_run).not_to create_file_with_content @file.name,
|
expect(@chef_run).not_to render_file(@file.name).with_content(/^allowed_sync_hots =/)
|
||||||
/^allowed_sync_hots =/
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
require 'spec_helper'
|
require_relative 'spec_helper'
|
||||||
|
|
||||||
describe 'openstack-object-storage::disks' do
|
describe 'openstack-object-storage::disks' do
|
||||||
|
|
||||||
@@ -10,11 +10,11 @@ describe 'openstack-object-storage::disks' do
|
|||||||
|
|
||||||
before do
|
before do
|
||||||
swift_stubs
|
swift_stubs
|
||||||
@chef_run = ::ChefSpec::ChefRunner.new ::UBUNTU_OPTS
|
@chef_run = ::ChefSpec::Runner.new ::UBUNTU_OPTS
|
||||||
@node = @chef_run.node
|
@node = @chef_run.node
|
||||||
@node.set['platform_family'] = "debian"
|
@node.set['platform_family'] = "debian"
|
||||||
@node.set['lsb']['codename'] = "precise"
|
@node.set['lsb']['codename'] = "precise"
|
||||||
@node.set['swift']['release'] = "grizzly"
|
@node.set['swift']['release'] = "havana"
|
||||||
@node.set['swift']['authmode'] = 'swauth'
|
@node.set['swift']['authmode'] = 'swauth'
|
||||||
@node.set['swift']['git_builder_ip'] = '10.0.0.10'
|
@node.set['swift']['git_builder_ip'] = '10.0.0.10'
|
||||||
@node.set['swift']['disk_enum_expr'] = "[{ 'sda' => {}}]"
|
@node.set['swift']['disk_enum_expr'] = "[{ 'sda' => {}}]"
|
||||||
@@ -39,5 +39,4 @@ describe 'openstack-object-storage::disks' do
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
require 'spec_helper'
|
require_relative 'spec_helper'
|
||||||
|
|
||||||
describe 'openstack-object-storage::management-server' do
|
describe 'openstack-object-storage::management-server' do
|
||||||
|
|
||||||
@@ -10,7 +10,7 @@ describe 'openstack-object-storage::management-server' do
|
|||||||
|
|
||||||
before do
|
before do
|
||||||
swift_stubs
|
swift_stubs
|
||||||
@chef_run = ::ChefSpec::ChefRunner.new ::UBUNTU_OPTS
|
@chef_run = ::ChefSpec::Runner.new ::UBUNTU_OPTS
|
||||||
@node = @chef_run.node
|
@node = @chef_run.node
|
||||||
@node.set['lsb']['code'] = 'precise'
|
@node.set['lsb']['code'] = 'precise'
|
||||||
@node.set['swift']['authmode'] = 'swauth'
|
@node.set['swift']['authmode'] = 'swauth'
|
||||||
@@ -32,7 +32,8 @@ describe 'openstack-object-storage::management-server' do
|
|||||||
end
|
end
|
||||||
|
|
||||||
it "has proper owner" do
|
it "has proper owner" do
|
||||||
expect(@file).to be_owned_by "swift", "swift"
|
expect(@file.owner).to eq("swift")
|
||||||
|
expect(@file.group).to eq("swift")
|
||||||
end
|
end
|
||||||
|
|
||||||
it "has proper modes" do
|
it "has proper modes" do
|
||||||
@@ -52,7 +53,8 @@ describe 'openstack-object-storage::management-server' do
|
|||||||
end
|
end
|
||||||
|
|
||||||
it "has proper owner" do
|
it "has proper owner" do
|
||||||
expect(@file).to be_owned_by "root", "root"
|
expect(@file.owner).to eq("root")
|
||||||
|
expect(@file.group).to eq("root")
|
||||||
end
|
end
|
||||||
|
|
||||||
it "has proper modes" do
|
it "has proper modes" do
|
||||||
@@ -60,8 +62,7 @@ describe 'openstack-object-storage::management-server' do
|
|||||||
end
|
end
|
||||||
|
|
||||||
it "has expected statsd host" do
|
it "has expected statsd host" do
|
||||||
expect(@chef_run).to create_file_with_content @file.name,
|
expect(@chef_run).to render_file(@file.name).with_content("self.statsd_host = '127.0.0.1'")
|
||||||
"self.statsd_host = '127.0.0.1'"
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
require 'spec_helper'
|
require_relative 'spec_helper'
|
||||||
|
|
||||||
describe 'openstack-object-storage::object-server' do
|
describe 'openstack-object-storage::object-server' do
|
||||||
|
|
||||||
@@ -10,7 +10,7 @@ describe 'openstack-object-storage::object-server' do
|
|||||||
|
|
||||||
before do
|
before do
|
||||||
swift_stubs
|
swift_stubs
|
||||||
@chef_run = ::ChefSpec::ChefRunner.new ::UBUNTU_OPTS
|
@chef_run = ::ChefSpec::Runner.new ::UBUNTU_OPTS
|
||||||
@node = @chef_run.node
|
@node = @chef_run.node
|
||||||
@node.set['lsb']['code'] = 'precise'
|
@node.set['lsb']['code'] = 'precise'
|
||||||
@node.set['swift']['authmode'] = 'swauth'
|
@node.set['swift']['authmode'] = 'swauth'
|
||||||
@@ -34,7 +34,7 @@ describe 'openstack-object-storage::object-server' do
|
|||||||
|
|
||||||
it "starts swift object services on boot" do
|
it "starts swift object services on boot" do
|
||||||
%w{swift-object swift-object-replicator swift-object-auditor swift-object-updater}.each do |svc|
|
%w{swift-object swift-object-replicator swift-object-auditor swift-object-updater}.each do |svc|
|
||||||
expect(@chef_run).to set_service_to_start_on_boot svc
|
expect(@chef_run).to enable_service(svc)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -53,7 +53,8 @@ describe 'openstack-object-storage::object-server' do
|
|||||||
end
|
end
|
||||||
|
|
||||||
it "has proper owner" do
|
it "has proper owner" do
|
||||||
expect(@file).to be_owned_by "swift", "swift"
|
expect(@file.owner).to eq("swift")
|
||||||
|
expect(@file.group).to eq("swift")
|
||||||
end
|
end
|
||||||
|
|
||||||
it "has proper modes" do
|
it "has proper modes" do
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
require 'spec_helper'
|
require_relative 'spec_helper'
|
||||||
|
|
||||||
describe 'openstack-object-storage::proxy-server' do
|
describe 'openstack-object-storage::proxy-server' do
|
||||||
|
|
||||||
@@ -10,7 +10,7 @@ describe 'openstack-object-storage::proxy-server' do
|
|||||||
|
|
||||||
before do
|
before do
|
||||||
swift_stubs
|
swift_stubs
|
||||||
@chef_run = ::ChefSpec::ChefRunner.new ::UBUNTU_OPTS
|
@chef_run = ::ChefSpec::Runner.new ::UBUNTU_OPTS
|
||||||
@node = @chef_run.node
|
@node = @chef_run.node
|
||||||
@node.set['lsb']['code'] = 'precise'
|
@node.set['lsb']['code'] = 'precise'
|
||||||
@node.set['swift']['authmode'] = 'swauth'
|
@node.set['swift']['authmode'] = 'swauth'
|
||||||
@@ -34,7 +34,7 @@ describe 'openstack-object-storage::proxy-server' do
|
|||||||
end
|
end
|
||||||
|
|
||||||
it "starts swift-proxy on boot" do
|
it "starts swift-proxy on boot" do
|
||||||
expect(@chef_run).to set_service_to_start_on_boot "swift-proxy"
|
expect(@chef_run).to enable_service("swift-proxy")
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "/etc/swift/proxy-server.conf" do
|
describe "/etc/swift/proxy-server.conf" do
|
||||||
@@ -44,7 +44,8 @@ describe 'openstack-object-storage::proxy-server' do
|
|||||||
end
|
end
|
||||||
|
|
||||||
it "has proper owner" do
|
it "has proper owner" do
|
||||||
expect(@file).to be_owned_by "swift", "swift"
|
expect(@file.owner).to eq("swift")
|
||||||
|
expect(@file.group).to eq("swift")
|
||||||
end
|
end
|
||||||
|
|
||||||
it "has proper modes" do
|
it "has proper modes" do
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
require 'spec_helper'
|
require_relative 'spec_helper'
|
||||||
|
|
||||||
describe 'openstack-object-storage::ring-repo' do
|
describe 'openstack-object-storage::ring-repo' do
|
||||||
|
|
||||||
@@ -10,11 +10,11 @@ describe 'openstack-object-storage::ring-repo' do
|
|||||||
|
|
||||||
before do
|
before do
|
||||||
swift_stubs
|
swift_stubs
|
||||||
@chef_run = ::ChefSpec::ChefRunner.new ::UBUNTU_OPTS
|
@chef_run = ::ChefSpec::Runner.new ::UBUNTU_OPTS
|
||||||
@node = @chef_run.node
|
@node = @chef_run.node
|
||||||
@node.set['platform_family'] = "debian"
|
@node.set['platform_family'] = "debian"
|
||||||
@node.set['lsb']['codename'] = "precise"
|
@node.set['lsb']['codename'] = "precise"
|
||||||
@node.set['swift']['release'] = "grizzly"
|
@node.set['swift']['release'] = "havana"
|
||||||
@node.set['swift']['authmode'] = 'swauth'
|
@node.set['swift']['authmode'] = 'swauth'
|
||||||
@node.set['swift']['git_builder_ip'] = '10.0.0.10'
|
@node.set['swift']['git_builder_ip'] = '10.0.0.10'
|
||||||
@chef_run.converge "openstack-object-storage::ring-repo"
|
@chef_run.converge "openstack-object-storage::ring-repo"
|
||||||
@@ -24,9 +24,9 @@ describe 'openstack-object-storage::ring-repo' do
|
|||||||
expect(@chef_run).to install_package "git-daemon-sysvinit"
|
expect(@chef_run).to install_package "git-daemon-sysvinit"
|
||||||
end
|
end
|
||||||
|
|
||||||
it "starts xinetd services on boot" do
|
it "should not start xinetd services on boot" do
|
||||||
%w{xinetd}.each do |svc|
|
%w{xinetd}.each do |svc|
|
||||||
expect(@chef_run).to set_service_to_start_on_boot svc
|
expect(@chef_run).not_to enable_service(svc)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
require 'spec_helper'
|
require_relative 'spec_helper'
|
||||||
|
|
||||||
describe 'openstack-object-storage::rsync' do
|
describe 'openstack-object-storage::rsync' do
|
||||||
|
|
||||||
@@ -10,11 +10,11 @@ describe 'openstack-object-storage::rsync' do
|
|||||||
|
|
||||||
before do
|
before do
|
||||||
swift_stubs
|
swift_stubs
|
||||||
@chef_run = ::ChefSpec::ChefRunner.new ::UBUNTU_OPTS
|
@chef_run = ::ChefSpec::Runner.new ::UBUNTU_OPTS
|
||||||
@node = @chef_run.node
|
@node = @chef_run.node
|
||||||
@node.set['platform_family'] = "debian"
|
@node.set['platform_family'] = "debian"
|
||||||
@node.set['lsb']['codename'] = "precise"
|
@node.set['lsb']['codename'] = "precise"
|
||||||
@node.set['swift']['release'] = "grizzly"
|
@node.set['swift']['release'] = "havana"
|
||||||
@node.set['swift']['authmode'] = 'swauth'
|
@node.set['swift']['authmode'] = 'swauth'
|
||||||
@node.set['swift']['git_builder_ip'] = '10.0.0.10'
|
@node.set['swift']['git_builder_ip'] = '10.0.0.10'
|
||||||
@chef_run.converge "openstack-object-storage::rsync"
|
@chef_run.converge "openstack-object-storage::rsync"
|
||||||
@@ -26,7 +26,7 @@ describe 'openstack-object-storage::rsync' do
|
|||||||
|
|
||||||
it "starts rsync service on boot" do
|
it "starts rsync service on boot" do
|
||||||
%w{rsync}.each do |svc|
|
%w{rsync}.each do |svc|
|
||||||
expect(@chef_run).to set_service_to_start_on_boot svc
|
expect(@chef_run).to enable_service(svc)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -37,13 +37,25 @@ MOCK_NODE_NETWORK_DATA =
|
|||||||
}
|
}
|
||||||
|
|
||||||
def swift_stubs
|
def swift_stubs
|
||||||
# create mock cluster
|
|
||||||
n = Chef::Node.new()
|
stub_command("/usr/bin/id swift").and_return(true)
|
||||||
n.name('manager')
|
stub_command("[ -x /etc/swift/pull-rings.sh ]").and_return(true)
|
||||||
n.default_attrs = {
|
stub_command("[ -f /etc/rsyncd.conf ]").and_return(true)
|
||||||
"swift" => {
|
stub_command("grep -q 'RSYNC_ENABLE=false' /etc/default/rsync").and_return(true)
|
||||||
"service_pass" => "foobar"
|
stub_command("[ -e /etc/swift/account-server.conf ] && [ -e /etc/swift/account.ring.gz ]").and_return(true)
|
||||||
}
|
stub_command("[ -e /etc/swift/container-server.conf ] && [ -e /etc/swift/container.ring.gz ]").and_return(true)
|
||||||
}
|
stub_command("[ -e /etc/init/swift-container-sync.conf ]").and_return(false)
|
||||||
|
stub_command("[ -e /etc/init.d/swift-container-sync ]").and_return(false)
|
||||||
|
stub_command("[ -e /etc/swift/object-server.conf ] && [ -e /etc/swift/object.ring.gz ]").and_return(true)
|
||||||
|
stub_command("[ -e /etc/swift/proxy-server.conf ] && [ -e /etc/swift/object.ring.gz ]").and_return(true)
|
||||||
|
|
||||||
|
# create mock cluster
|
||||||
|
n = Chef::Node.new()
|
||||||
|
n.name('manager')
|
||||||
|
n.default_attrs = {
|
||||||
|
"swift" => {
|
||||||
|
"service_pass" => "foobar"
|
||||||
|
}
|
||||||
|
}
|
||||||
Chef::Recipe.any_instance.stub(:search).with(:node, 'chef_environment:_default AND roles:swift-setup').and_return([n])
|
Chef::Recipe.any_instance.stub(:search).with(:node, 'chef_environment:_default AND roles:swift-setup').and_return([n])
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
require 'spec_helper'
|
require_relative 'spec_helper'
|
||||||
|
|
||||||
describe 'openstack-object-storage::storage-common' do
|
describe 'openstack-object-storage::storage-common' do
|
||||||
|
|
||||||
@@ -10,7 +10,7 @@ describe 'openstack-object-storage::storage-common' do
|
|||||||
|
|
||||||
before do
|
before do
|
||||||
swift_stubs
|
swift_stubs
|
||||||
@chef_run = ::ChefSpec::ChefRunner.new ::UBUNTU_OPTS
|
@chef_run = ::ChefSpec::Runner.new ::UBUNTU_OPTS
|
||||||
@node = @chef_run.node
|
@node = @chef_run.node
|
||||||
@node.set['lsb']['code'] = 'precise'
|
@node.set['lsb']['code'] = 'precise'
|
||||||
@node.set['swift']['authmode'] = 'swauth'
|
@node.set['swift']['authmode'] = 'swauth'
|
||||||
@@ -24,7 +24,8 @@ describe 'openstack-object-storage::storage-common' do
|
|||||||
end
|
end
|
||||||
|
|
||||||
it "has proper owner" do
|
it "has proper owner" do
|
||||||
expect(@file).to be_owned_by "swift", "swift"
|
expect(@file.owner).to eq("swift")
|
||||||
|
expect(@file.group).to eq("swift")
|
||||||
end
|
end
|
||||||
|
|
||||||
it "has proper modes" do
|
it "has proper modes" do
|
||||||
@@ -40,7 +41,8 @@ describe 'openstack-object-storage::storage-common' do
|
|||||||
end
|
end
|
||||||
|
|
||||||
it "has proper owner" do
|
it "has proper owner" do
|
||||||
expect(@file).to be_owned_by "swift", "swift"
|
expect(@file.owner).to eq("swift")
|
||||||
|
expect(@file.group).to eq("swift")
|
||||||
end
|
end
|
||||||
|
|
||||||
it "has proper modes" do
|
it "has proper modes" do
|
||||||
|
|||||||
Reference in New Issue
Block a user