From 96c6b78b67e11d145f57373542a6b537562a9691 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?C=C3=A9dric=20Le=20Ninivin?= <cedric.leninivin@tiolive.com>
Date: Thu, 20 Sep 2012 13:26:42 +0200
Subject: [PATCH] Slapproxy won't raise if slave note ready

---
 slapos/proxy/views.py     | 2 +-
 slapos/tests/slapproxy.py | 3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/slapos/proxy/views.py b/slapos/proxy/views.py
index e9afb409f..e1ad190e6 100644
--- a/slapos/proxy/views.py
+++ b/slapos/proxy/views.py
@@ -427,7 +427,7 @@ def request_slave():
         _connection_dict=xml2dict(slave['connection_xml']),
         xml = instance_xml,
         slap_computer_id=app.config['computer_id'],
-        slap_computer_partition_id=slave['hosted_by'],
+        slap_computer_partition_id=partition['reference'],
         slap_software_release_url=partition['software_release'],
         slap_server_url='slap_server_url',
         slap_software_type=partition['software_type'],
diff --git a/slapos/tests/slapproxy.py b/slapos/tests/slapproxy.py
index 3137fb678..e3ca52100 100644
--- a/slapos/tests/slapproxy.py
+++ b/slapos/tests/slapproxy.py
@@ -322,8 +322,7 @@ class TestRequest (MasterMixin, unittest.TestCase):
     master_partition_id = self.request('http://sr//', None,
                                     'Maria', 'slappart4')._partition_id
     # Failed request of slave instance
-    with self.assertRaises(TypeError):
-      self.request('http://sr//', None, 'Maria', 'slappart2', shared=True)
+    self.request('http://sr//', None, 'Maria', 'slappart2', shared=True)
     # Get updated information for master partition
     rv = self.app.get('/getFullComputerInformation?computer_id='
                       + self.computer_id)
-- 
2.30.9