aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarry Huang <huangxiangyu5@huawei.com>2018-11-07 20:20:17 +0800
committerHarry Huang <huangxiangyu5@huawei.com>2018-11-07 20:22:17 +0800
commitf0cfbec4469e30292f0e7fee0075b0e1e04cdf07 (patch)
tree5b88380a4fe6958fd341464834d15f1c323d9542
parenta60e70f7375a7371b0295d7eb659a7204b402d91 (diff)
Patch nova to fix functest issue
JIRA:- Change-Id: Ia10c35e5feb91200fba61ba36d76555f53babe18 Signed-off-by: Harry Huang <huangxiangyu5@huawei.com>
-rw-r--r--deploy/adapters/ansible/roles/post-openstack/files/manager.py.patch12
-rw-r--r--deploy/adapters/ansible/roles/post-openstack/tasks/main.yml5
-rwxr-xr-xdeploy/adapters/ansible/roles/post-openstack/tasks/nova_patch.yml23
3 files changed, 39 insertions, 1 deletions
diff --git a/deploy/adapters/ansible/roles/post-openstack/files/manager.py.patch b/deploy/adapters/ansible/roles/post-openstack/files/manager.py.patch
new file mode 100644
index 0000000..2adaa4f
--- /dev/null
+++ b/deploy/adapters/ansible/roles/post-openstack/files/manager.py.patch
@@ -0,0 +1,12 @@
+--- manager.py 2018-11-07 03:51:22.764685289 -0800
++++ manager.py.new 2018-11-07 03:58:21.014139558 -0800
+@@ -314,8 +314,7 @@
+ if self._events is None:
+ # NOTE(danms): We really should have a more specific error
+ # here, but this is what we use for our default error case
+- raise exception.NovaException('In shutdown, no new events '
+- 'can be scheduled')
++ pass
+
+ @utils.synchronized(self._lock_name(instance))
+ def _create_or_get_event():
diff --git a/deploy/adapters/ansible/roles/post-openstack/tasks/main.yml b/deploy/adapters/ansible/roles/post-openstack/tasks/main.yml
index 0bd9aef..4a59b75 100644
--- a/deploy/adapters/ansible/roles/post-openstack/tasks/main.yml
+++ b/deploy/adapters/ansible/roles/post-openstack/tasks/main.yml
@@ -53,7 +53,6 @@
when:
- inventory_hostname == groups['utility_all'][0]
-
- name: fetch openrc
fetch:
src: /root/openrc
@@ -86,3 +85,7 @@
state: restarted
when:
- inventory_hostname in groups['horizon']
+
+- include: nova_patch.yml
+ when:
+ - inventory_hostname in groups['compute']
diff --git a/deploy/adapters/ansible/roles/post-openstack/tasks/nova_patch.yml b/deploy/adapters/ansible/roles/post-openstack/tasks/nova_patch.yml
new file mode 100755
index 0000000..8a35ab6
--- /dev/null
+++ b/deploy/adapters/ansible/roles/post-openstack/tasks/nova_patch.yml
@@ -0,0 +1,23 @@
+#############################################################################
+# Copyright (c) 2018 HUAWEI TECHNOLOGIES CO.,LTD 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
+##############################################################################
+---
+- name: copy manager.py.patch
+ copy:
+ src: manager.py.patch
+ dest: /openstack/venvs/nova-{{ openstack_release }}/lib/python2.7/site-packages/nova/compute
+
+- name: patch manager.py.patch
+ shell:
+ patch -p0 < manager.py.patch
+ args:
+ chdir: /openstack/venvs/nova-{{ openstack_release }}/lib/python2.7/site-packages/nova/compute
+
+- name: restart nova-compute
+ shell:
+ systemctl restart nova-compute