diff --git a/manifests/type_set.pp b/manifests/type_set.pp index acbe7fda..3f250b9a 100644 --- a/manifests/type_set.pp +++ b/manifests/type_set.pp @@ -58,6 +58,7 @@ define cinder::type_set ( exec {"cinder type-key ${type} set ${key}=${name}": path => ['/usr/bin', '/bin'], command => "cinder type-key ${type} set ${key}=${name}", + unless => "cinder extra-specs-list | grep -Eq '\b${type}\b.*\b${key}\b.*\b${name}\b'", environment => concat($cinder_env, $region_env), require => Package['python-cinderclient'] } diff --git a/spec/defines/cinder_type_set_spec.rb b/spec/defines/cinder_type_set_spec.rb index 4cb57c18..2faba85e 100644 --- a/spec/defines/cinder_type_set_spec.rb +++ b/spec/defines/cinder_type_set_spec.rb @@ -19,6 +19,7 @@ describe 'cinder::type_set' do it 'should have its execs' do should contain_exec('cinder type-key sith set monchichi=hippo').with( :command => 'cinder type-key sith set monchichi=hippo', + :unless => "cinder extra-specs-list | grep -Eq '\\bsith\\b.*\\bmonchichi\\b.*\\bhippo\\b'", :environment => [ 'OS_TENANT_NAME=admin', 'OS_USERNAME=admin',