0008-Fix-wrong-parameter-while-creating-bay.patch 1.88 KB
From 4b6ed3746980d9574599a6b273710ac1de70b7be Mon Sep 17 00:00:00 2001
From: Eli Qiao <liyong.qiao@intel.com>
Date: Thu, 7 Apr 2016 11:12:08 +0800
Subject: [PATCH 8/8] Fix wrong parameter while creating bay

delete_trustee_and_trust() takes 3 arguments.

Closes-Bug: #1567195
Change-Id: I1bb9fd8b97fedc1e23159248d5efa5c2d4b896bd
---
 magnum/conductor/handlers/bay_conductor.py                 | 2 +-
 magnum/tests/unit/conductor/handlers/test_bay_conductor.py | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/magnum/conductor/handlers/bay_conductor.py b/magnum/conductor/handlers/bay_conductor.py
index 90ed531..bd250b0 100644
--- a/magnum/conductor/handlers/bay_conductor.py
+++ b/magnum/conductor/handlers/bay_conductor.py
@@ -134,7 +134,7 @@ class Handler(object):
                                           bay_create_timeout)
         except Exception as e:
             cert_manager.delete_certificates_from_bay(bay)
-            trust_manager.delete_trustee_and_trust(osc, bay)
+            trust_manager.delete_trustee_and_trust(osc, context, bay)
 
             if isinstance(e, exc.HTTPBadRequest):
                 e = exception.InvalidParameterValue(message=six.text_type(e))
diff --git a/magnum/tests/unit/conductor/handlers/test_bay_conductor.py b/magnum/tests/unit/conductor/handlers/test_bay_conductor.py
index ca6d5b8..5281364 100644
--- a/magnum/tests/unit/conductor/handlers/test_bay_conductor.py
+++ b/magnum/tests/unit/conductor/handlers/test_bay_conductor.py
@@ -222,7 +222,7 @@ class TestHandler(db_base.DbTestCase):
 
         mock_cert_manager.delete_certificates_from_bay(self.bay)
         mock_trust_manager.delete_trustee_and_trust.assert_called_once_with(
-            osc, self.bay)
+            osc, self.context, self.bay)
 
     @patch('magnum.conductor.handlers.bay_conductor.trust_manager')
     @patch('magnum.conductor.handlers.bay_conductor.cert_manager')
-- 
2.5.5