summaryrefslogtreecommitdiffstats
path: root/mcp
diff options
context:
space:
mode:
authorMichael Polenchuk <mpolenchuk@mirantis.com>2019-02-26 14:52:06 +0400
committerMichael Polenchuk <mpolenchuk@mirantis.com>2019-02-26 14:52:06 +0400
commitac56d7b14f46b05f497b3dca4b6a4b0bfedd83e2 (patch)
tree47729a5c2819f724c20012de518a1f2db309126f /mcp
parent64e74e396038b30da1df2bfc9271ff6d1d3f8ff5 (diff)
Fix race condition with nova privsep utime
Bug: https://bugs.launchpad.net/nova/+bug/1809123 Change-Id: I14622c21826aeeddac6ea7bf7f9d116cd3e68cfb Signed-off-by: Michael Polenchuk <mpolenchuk@mirantis.com>
Diffstat (limited to 'mcp')
-rwxr-xr-xmcp/config/states/nova_nfs_utime14
-rwxr-xr-xmcp/config/states/openstack_ha1
-rwxr-xr-xmcp/config/states/openstack_noha1
3 files changed, 16 insertions, 0 deletions
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 85e32158d..5027a8c2e 100755
--- a/mcp/config/states/openstack_ha
+++ b/mcp/config/states/openstack_ha
@@ -55,6 +55,7 @@ if salt 'cmp*' match.pillar 'neutron:compute:backend:engine:ovn' \
salt -I 'neutron:compute' state.sls neutron.compute
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
diff --git a/mcp/config/states/openstack_noha b/mcp/config/states/openstack_noha
index 7db100f6a..f5782aca2 100755
--- a/mcp/config/states/openstack_noha
+++ b/mcp/config/states/openstack_noha
@@ -41,6 +41,7 @@ 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
+$(dirname "${BASH_SOURCE[0]}")/nova_nfs_utime
salt -I 'nova:compute' state.sls nova,armband
salt -I 'barbican:server' state.sls barbican