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:
parent
76c53637ad
commit
9ef8773f8b
@ -66,7 +66,7 @@ define cinder::type (
|
|||||||
|
|
||||||
exec {"cinder type-create ${volume_name}":
|
exec {"cinder type-create ${volume_name}":
|
||||||
command => "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),
|
environment => concat($cinder_env, $region_env),
|
||||||
require => Package['python-cinderclient'],
|
require => Package['python-cinderclient'],
|
||||||
path => ['/usr/bin', '/bin'],
|
path => ['/usr/bin', '/bin'],
|
||||||
|
@ -24,7 +24,7 @@ describe 'cinder::type' do
|
|||||||
'OS_USERNAME=admin',
|
'OS_USERNAME=admin',
|
||||||
'OS_PASSWORD=asdf',
|
'OS_PASSWORD=asdf',
|
||||||
'OS_AUTH_URL=http://127.127.127.1:5000/v2.0/'],
|
'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',
|
:tries => '2',
|
||||||
:try_sleep => '5',
|
:try_sleep => '5',
|
||||||
:require => 'Package[python-cinderclient]')
|
:require => 'Package[python-cinderclient]')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user