Patch nova to fix functest issue 41/64841/1
authorHarry Huang <huangxiangyu5@huawei.com>
Fri, 9 Nov 2018 02:14:51 +0000 (10:14 +0800)
committerHarry Huang <huangxiangyu5@huawei.com>
Fri, 9 Nov 2018 02:14:51 +0000 (10:14 +0800)
JIRA:-

Change-Id: Ic084aa861ad0dacea34c858d0fb371abe3049727
Signed-off-by: Harry Huang <huangxiangyu5@huawei.com>
deploy/adapters/ansible/openstack/HA-ansible-multinodes.yml
deploy/adapters/ansible/roles/post-openstack/files/manager.py.patch [new file with mode: 0644]
deploy/adapters/ansible/roles/post-openstack/tasks/main.yml
deploy/adapters/ansible/roles/post-openstack/tasks/nova_patch.yml [new file with mode: 0644]
manager.py.patch [new file with mode: 0644]

index 874fcfb..152a7dc 100644 (file)
     - utility_all[0]
     - network_hosts[0]
     - horizon
+    - compute
   remote_user: root
   roles:
     - post-openstack
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 (file)
index 0000000..198ff5b
--- /dev/null
@@ -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')
++            self._events = {}
+
+         @utils.synchronized(self._lock_name(instance))
+         def _create_or_get_event():
index 0bd9aef..2a63acf 100644 (file)
@@ -86,3 +86,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 100644 (file)
index 0000000..d9cfad9
--- /dev/null
@@ -0,0 +1,23 @@
+##############################################################################
+# Copyright (c) 2016-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
diff --git a/manager.py.patch b/manager.py.patch
new file mode 100644 (file)
index 0000000..198ff5b
--- /dev/null
@@ -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')
++            self._events = {}
+
+         @utils.synchronized(self._lock_name(instance))
+         def _create_or_get_event():