Sync the DB2 communication error code change from olso

Closes-Bug: #1244092

oslo patch set: 3acd57c2825a8bf6660c3124f12794414622eb26

Change-Id: I62e3a6d1137d53c4aa72b18db5bd9f7e41694436
This commit is contained in:
gengjh
2013-10-27 19:25:13 +08:00
parent 13163ab800
commit 80d6439e7e

View File

@@ -611,7 +611,8 @@ def _is_db_connection_error(args):
"""Return True if error in connecting to db."""
# NOTE(adam_g): This is currently MySQL specific and needs to be extended
# to support Postgres and others.
conn_err_codes = ('2002', '2003', '2006')
# For the db2, the error code is -30081 since the db2 is still not ready
conn_err_codes = ('2002', '2003', '2006', '-30081')
for err_code in conn_err_codes:
if args.find(err_code) != -1:
return True