From 2257678a764eef8e60079a6450c0ca6dcdd7b890 Mon Sep 17 00:00:00 2001
From: Romain Courteaud <romain@nexedi.com>
Date: Wed, 26 Sep 2012 16:24:13 +0200
Subject: [PATCH] getId now raises if instance is not allocated yet

---
 .../product/Vifib/tests/testVifibSlapWebService.py  | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/master/product/Vifib/tests/testVifibSlapWebService.py b/master/product/Vifib/tests/testVifibSlapWebService.py
index 4419d4b88..512971df1 100644
--- a/master/product/Vifib/tests/testVifibSlapWebService.py
+++ b/master/product/Vifib/tests/testVifibSlapWebService.py
@@ -2093,10 +2093,15 @@ class TestVifibSlapWebServiceMixin(testVifibMixin):
     requested_slap_computer_partition = slap_computer_partition.request(**kw)
     self.stepTic()
 
-    sequence.edit(
-        requested_slap_computer_partition=requested_slap_computer_partition,
-        requested_computer_partition_reference=\
-            requested_slap_computer_partition.getId())
+    try:
+      requested_slap_computer_partition.getId()
+    except slap.ResourceNotReady:
+      pass
+    else:
+      sequence.edit(
+          requested_slap_computer_partition=requested_slap_computer_partition,
+          requested_computer_partition_reference=\
+              requested_slap_computer_partition.getId())
 
   def _stepSetSoftwareInstanceChildren(self, sequence, source_reference):
     software_instance_uid = sequence['root_software_instance_uid']
-- 
2.30.9