@@ -92,7 +92,9 @@ def attach(self, *args, **kwargs):
9292 @transaction .atomic
9393 def delete (self , * args , ** kwargs ):
9494 if self .binding == "Ready" :
95- raise DryccException ("the plan is still binding" )
95+ raise DryccException ("the resource instance is still binding" )
96+ if self .status == "Provisioning" :
97+ raise DryccException ("the resource instance is provisioning" )
9698 # Deatch ServiceInstance, updates k8s
9799 self .detach (* args , ** kwargs )
98100 # Delete from DB
@@ -119,9 +121,9 @@ def log(self, message, level=logging.INFO):
119121
120122 def bind (self , * args , ** kwargs ):
121123 if self .status != "Ready" :
122- raise DryccException ("the resource is not ready" )
124+ raise DryccException ("the resource instance is not ready" )
123125 if self .binding == "Ready" :
124- raise DryccException ("the resource is binding" )
126+ raise DryccException ("the resource instance is binding" )
125127 self .binding = "Binding"
126128 self .save ()
127129 try :
@@ -141,7 +143,7 @@ def bind(self, *args, **kwargs):
141143
142144 def unbind (self , * args , ** kwargs ):
143145 if not self .binding :
144- raise DryccException ("the resource is not binding" )
146+ raise DryccException ("the resource instance is not binding" )
145147 try :
146148 # We raise an exception when a resource doesn't exist
147149 self ._scheduler .svcat .get_binding (self .app .id , self .name )
@@ -168,7 +170,7 @@ def attach_update(self, *args, **kwargs):
168170 "parameters" : self .options ,
169171 "external_id" : data ["spec" ]["externalID" ]
170172 }
171- self ._scheduler .svcat .put_instance (
173+ self ._scheduler .svcat .patch_instance (
172174 self .app .id , self .name , version , ** kwargs
173175 )
174176 except KubeException as e :
0 commit comments