Use whitespace for cinder type-list check.

Hyphens will be matched as a word boundary, so use whitespace to
avoid false positives. For example, with an exisiting "demo-type1"
we can't create a new "type1".

Change-Id: I1167d3e870d1834f57f5cf64ab5cf796344de027
This commit is contained in:
Matt Popow 2015-12-03 00:21:35 -08:00
parent 76c53637ad
commit 9ef8773f8b
2 changed files with 2 additions and 2 deletions
manifests
spec/defines

@ -66,7 +66,7 @@ define cinder::type (
exec {"cinder type-create ${volume_name}":
command => "cinder type-create ${volume_name}",
unless => "cinder type-list | grep -qP '\\b${volume_name}\\b'",
unless => "cinder type-list | grep -qP '\\s${volume_name}\\s'",
environment => concat($cinder_env, $region_env),
require => Package['python-cinderclient'],
path => ['/usr/bin', '/bin'],

@ -24,7 +24,7 @@ describe 'cinder::type' do
'OS_USERNAME=admin',
'OS_PASSWORD=asdf',
'OS_AUTH_URL=http://127.127.127.1:5000/v2.0/'],
:unless => "cinder type-list | grep -qP '\\bhippo\\b'",
:unless => "cinder type-list | grep -qP '\\shippo\\s'",
:tries => '2',
:try_sleep => '5',
:require => 'Package[python-cinderclient]')