Skip to content

Commit b47ee25

Browse files
Jenkinsopenstack-gerrit
Jenkins
authored andcommitted
Merge "Update virsh secret if rbd_keyring or libvirt_rbd_secret_uuid change" into stable/mitaka
2 parents de2d537 + 5650a35 commit b47ee25

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

manifests/compute/rbd.pp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102

103103
exec { 'get-or-set virsh secret':
104104
command => '/usr/bin/virsh secret-define --file /etc/nova/secret.xml | /usr/bin/awk \'{print $2}\' | sed \'/^$/d\' > /etc/nova/virsh.secret',
105-
creates => '/etc/nova/virsh.secret',
105+
unless => "/usr/bin/virsh secret-list | grep ${libvirt_rbd_secret_uuid}",
106106
require => [File['/etc/nova/secret.xml'], Service['libvirt']],
107107
}
108108

@@ -113,7 +113,7 @@
113113
}
114114
exec { 'set-secret-value virsh':
115115
command => "/usr/bin/virsh secret-set-value --secret ${libvirt_rbd_secret_uuid} --base64 ${libvirt_key}",
116-
unless => "/usr/bin/virsh secret-get-value ${libvirt_rbd_secret_uuid}",
116+
unless => "/usr/bin/virsh secret-get-value ${libvirt_rbd_secret_uuid} | grep ${libvirt_key}",
117117
require => Exec['get-or-set virsh secret'],
118118
before => Anchor['nova::config::end'],
119119
}

spec/classes/nova_compute_rbd_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
])
9090
is_expected.to contain_exec('get-or-set virsh secret').with(
9191
:command => '/usr/bin/virsh secret-define --file /etc/nova/secret.xml | /usr/bin/awk \'{print $2}\' | sed \'/^$/d\' > /etc/nova/virsh.secret',
92-
:creates => '/etc/nova/virsh.secret',
92+
:unless => '/usr/bin/virsh secret-list | grep UUID',
9393
:require => ['File[/etc/nova/secret.xml]', 'Service[libvirt]'],
9494
)
9595
is_expected.to contain_exec('set-secret-value virsh').with(
@@ -140,7 +140,7 @@
140140
])
141141
is_expected.to contain_exec('get-or-set virsh secret').with(
142142
:command => '/usr/bin/virsh secret-define --file /etc/nova/secret.xml | /usr/bin/awk \'{print $2}\' | sed \'/^$/d\' > /etc/nova/virsh.secret',
143-
:creates => '/etc/nova/virsh.secret',
143+
:unless => '/usr/bin/virsh secret-list | grep UUID',
144144
:require => ['File[/etc/nova/secret.xml]', 'Service[libvirt]'],
145145
)
146146
is_expected.to contain_exec('set-secret-value virsh').with(

0 commit comments

Comments
 (0)