From 788de2558aff99adddcc3a916dc1c8d888f1368c Mon Sep 17 00:00:00 2001 From: Michael Polenchuk Date: Tue, 26 Feb 2019 14:52:06 +0400 Subject: Fix race condition with nova privsep utime Bug: https://bugs.launchpad.net/nova/+bug/1809123 Change-Id: I14622c21826aeeddac6ea7bf7f9d116cd3e68cfb Signed-off-by: Michael Polenchuk (cherry picked from commit ac56d7b14f46b05f497b3dca4b6a4b0bfedd83e2) --- mcp/config/states/nova_nfs_utime | 14 ++++++++++++++ mcp/config/states/openstack_ha | 7 ++----- mcp/config/states/openstack_noha | 7 ++----- 3 files changed, 18 insertions(+), 10 deletions(-) create mode 100755 mcp/config/states/nova_nfs_utime diff --git a/mcp/config/states/nova_nfs_utime b/mcp/config/states/nova_nfs_utime new file mode 100755 index 000000000..b8c046866 --- /dev/null +++ b/mcp/config/states/nova_nfs_utime @@ -0,0 +1,14 @@ +#!/bin/bash -e +############################################################################## +# Copyright (c) 2019 Mirantis Inc., Enea AB and others. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +salt -I 'nova:compute' pkg.install python-nova +# https://bugs.launchpad.net/nova/+bug/1809123 +salt -I 'nova:compute' file.replace /usr/lib/python2.7/dist-packages/nova/privsep/path.py \ + pattern="^\s{4}os\.utime\(path, None\)" \ + repl="\n with open(path, 'a'):\n os.utime(path, None)" diff --git a/mcp/config/states/openstack_ha b/mcp/config/states/openstack_ha index 924dc30f1..bb984c6e5 100755 --- a/mcp/config/states/openstack_ha +++ b/mcp/config/states/openstack_ha @@ -56,11 +56,8 @@ if salt 'cmp*' match.pillar 'neutron:compute:backend:engine:ovn' \ salt -I 'neutron:compute' state.sls neutron.compute fi -salt -I 'nova:compute' state.sls nova -if salt -I 'nova:compute' match.grain 'cpuarch:aarch64' \ - --out yaml --static | grep -q -e 'true' ; then - salt -C 'G@cpuarch:aarch64 and I@nova:compute' state.sls armband -fi +$(dirname "${BASH_SOURCE[0]}")/nova_nfs_utime +salt -I 'nova:compute' state.sls nova,armband salt -I 'barbican:server:role:primary' state.sls barbican salt -I 'barbican:server:role:secondary' state.sls barbican -b 1 diff --git a/mcp/config/states/openstack_noha b/mcp/config/states/openstack_noha index 85a2f47ca..36c5282ce 100755 --- a/mcp/config/states/openstack_noha +++ b/mcp/config/states/openstack_noha @@ -44,11 +44,8 @@ wait_for 3 "salt -I 'cinder:volume' state.sls cinder" salt -I 'neutron:server' state.sls etcd,neutron salt -I 'neutron:compute' state.sls neutron -salt -I 'nova:compute' state.sls nova -if salt -I 'nova:compute' match.grain 'cpuarch:aarch64' \ - --out yaml --static | grep -q -e 'true' ; then - salt -C 'G@cpuarch:aarch64 and I@nova:compute' state.sls armband -fi +$(dirname "${BASH_SOURCE[0]}")/nova_nfs_utime +salt -I 'nova:compute' state.sls nova,armband salt -I 'barbican:server' state.sls barbican salt -I 'barbican:client' state.sls barbican -- cgit 1.2.3-korg