From e3a4c7d77d3948275a1171241c0bbbbed7c61d7c Mon Sep 17 00:00:00 2001
From: Kamlesh Chauvhan <kamlesh.chauvhan@gmail.com>
Date: Thu, 17 Jun 2021 09:52:37 +0000
Subject: [PATCH] Upgrade oslo.db version

oslo.db 9.1.0 extends capabilities to handle changes
in duplicate key error information introduced since
MySQL 8.0.19 and fixes issue arose during inspection
of node created with idrac driver, inspect interface
as idrac-redfish.

Story: 2008901
Task: 42468
Change-Id: Ic18e485d4eb14566554d25379a719669ac362d70
---
 ...sh_inspection_bugfix-b5edd35c337f80fc.yaml | 23 +++++++++++++++++++
 requirements.txt                              |  2 +-
 2 files changed, 24 insertions(+), 1 deletion(-)
 create mode 100644 releasenotes/notes/upgrade_oslo_db_version-idrac_redfish_inspection_bugfix-b5edd35c337f80fc.yaml

diff --git a/releasenotes/notes/upgrade_oslo_db_version-idrac_redfish_inspection_bugfix-b5edd35c337f80fc.yaml b/releasenotes/notes/upgrade_oslo_db_version-idrac_redfish_inspection_bugfix-b5edd35c337f80fc.yaml
new file mode 100644
index 0000000000..7371f48789
--- /dev/null
+++ b/releasenotes/notes/upgrade_oslo_db_version-idrac_redfish_inspection_bugfix-b5edd35c337f80fc.yaml
@@ -0,0 +1,23 @@
+---
+fixes:
+  - |
+    Fixes issue arose during inspection of iDRAC node with inspect-interface
+    as idrac-redfish. Earlier, inspection of node was getting failed with
+    error ``port already exists``.
+    This issue arose since MySQL 8.0.19 where duplicate key error
+    information is extended to include the table name in the key. Previously,
+    duplicate key error information included only the key value and key name.
+
+    For more information, see `story 2008901
+    <https://storyboard.openstack.org/#!/story/2008901>`_.
+upgrade:
+  - |
+    The minimum requirement for the ``oslo.db`` library is now version
+    9.1.0 to address duplicate key error changes in MySQL 8.0.19.
+    oslo.db version 9.1.0 fixes issue of idrac driver node inspection
+    for inspect interface as idrac-redfish.
+    Issue was introduced since MySQL 8.0.19 where duplicate key error
+    information is extended to include the table name in the key.
+
+    For more information, see `story 2008901
+    <https://storyboard.openstack.org/#!/story/2008901>`_.
\ No newline at end of file
diff --git a/requirements.txt b/requirements.txt
index ca59703ccb..dcc2a4cc88 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -17,7 +17,7 @@ stevedore>=1.20.0 # Apache-2.0
 oslo.concurrency>=4.2.0 # Apache-2.0
 oslo.config>=6.8.0 # Apache-2.0
 oslo.context>=2.19.2 # Apache-2.0
-oslo.db>=6.0.0 # Apache-2.0
+oslo.db>=9.1.0 # Apache-2.0
 oslo.rootwrap>=5.8.0 # Apache-2.0
 oslo.log>=4.3.0 # Apache-2.0
 oslo.middleware>=3.31.0 # Apache-2.0