+
    lj                     ,   ^ RI t ^ RIt^ RIt^ RIt^ RIHt ^ RIHt ^ RI	H
t
 ^ RIHt ^ RIH
t ]P                  t]P                   ! ]4      tR t]P(                  ! R4      RKR l4       t]P(                  ! R	4      RLR
 l4       tR tR tR tRMR ltR tRNR ltR tR tR tR t R t!RMR lt"R t#R t$RLR lt%ROR lt&R t'RPR lt(R t)RQR lt*R t+RRR  lt,R! t-R" t.RSR# lt/RTR$ lt0RUR% lt1R& t2R' t3R( t4R) t5]P(                  ! R*4      R+ 4       t6]P(                  ! R,4      RLR- l4       t7]P(                  ! R.4      R/ 4       t8R0 t9RQR1 lt:R2 t;R3 t<R4 t=R5 t>R6 t?R7 t@R8 tAR9 tBRMR: ltCR; tDR< tE]P(                  ! R=4      R> 4       tF]P(                  ! R?4      R@ 4       tG]P(                  ! RA4      RB 4       tH]P(                  ! RC4      RD 4       tI]P(                  ! RE4      RF 4       tJ]P(                  ! RG4      RH 4       tK]P(                  ! RI4      RJ 4       tLR# )V    N)log)config)
exceptions)
test_utilsc                 &    V P                  R R4      # )zOS-EXT-STS:task_stateN)get)bodys   &Z/Users/user/workspace/sujinbaek/cqa-test-app/flava-qa/cqa-cloud-api-test/common/waiters.py_get_task_stater      s    88+T22    zWait for server statusc           
     l  a V P                  V4      R,          pVR,          ;r\        V4      ;r\        \        P                  ! 4       4      pV P                  V,           pRo VR8X  d
   V	R8w  d   V# W8X  Ed   V'       Ed   VR8X  d   V# Rp\
        P                  P                  '       Ed8   VR8X  Ed0   VR,          oR	p. R&Op\
        P                  P                  R8X  d   . R'Op\        ;QJ d    V3R lV 4       F  '       d   K   RM	  RM! V3R lV 4       4      '       d   V F  pSP                  V4      R8w  g   K  VR
8X  d/   \        P                  ! VSP                  V4      4      '       d   KP  RV RSP                  V4       2pV'       d   VR,          pVRV,          ,          p\        P                  ! VVR7      h	  MRp\         P#                  RS4       V'       d5   Vf1   \        P$                  ! \
        P                  P&                  4       V# MV# \        P$                  ! V P(                  4       V P                  V4      R,          pVR,          p	\        V4      pW8w  g   W8w  dg   \         P+                  RRP-                  V\/        V
4      34      RP-                  V	\/        V4      34      \        P                  ! 4       V,
          4       V	R8X  db   V'       dZ   RpRV9   d   VRVR,          ,          ,          pV'       d   VR,          pVRV,          ,          p\        P                  ! VVR7      h\        \        P                  ! 4       4      V,
          V8  pV'       d   V'       d   RMRpRRVRVRVR V/,          pV'       d   VR,          pVRV,          ,          pVR!V	,          ,          pVR"V,          ,          pS'       d   VR#S,          ,          p\0        P2                  ! 4       pV'       d   R$V: R%V: 2p\4        P6                  ! V4      hT	pTp
EK  )(z+Waits for a server to reach a given status.serverstatusNTBUILDUNKNOWNACTIVEmetadatazM^([0-9A-Z]{1,4}-)?[0-9A-Z]{1,4}-[0-9A-Z]{1,4}-[0-9A-Z]{1,4}(-[0-9A-Z]{1,4})?$failure_domainflavac              3   ,   <"   T F	  qS9   x  K  	  R # 5iN ).0keyr   s   & r
   	<genexpr>)wait_for_server_status.<locals>.<genexpr>K   s     Dms(?ms   FOKz'Error occurred in the follow metadata: z = z0 Request ID of server operation performed beforez checking the server status %s.)	server_idzAServer status is ACTIVE, but waiting for metadata information. %s3State transition "%s" ==> "%s" after %d second wait/ERROR faultz
Fault: %s.Nonezn/azServer %(server_id)s failed to reach %(status)s status and task state "%(expected_task_state)s" and metadata 'OK' within the required time (%(timeout)s s).r   expected_task_statetimeoutz Current status: %s.z Current task state: %s.z Current metadata: %s.() )cmdbipdbpingssh
dns_lookupr   )r-   r+   toposr-   r   )show_serverr   inttimebuild_timeoutCONFcomputevalidate_metadatacommontarget_cloudallr   rematchr   BuildErrorExceptionLOGdebugsleep
ready_waitbuild_intervalinfojoinstrr   find_test_callerlib_excTimeoutException)clientr   r   r?   extra_timeoutraise_on_error
request_idr	   
old_statusserver_statusold_task_state
task_state
start_timer&   all_metadata_okfailure_domain_patternkeys_to_checkr   details	timed_outr%   messagecallerr   s   &&&&&&&                @r
   wait_for_server_statusrW   !   s    i(2D!%h/J"1$"77NTYY[!J""]2GH
 W)!;K"zW$K"&<<111f6H#J/Hh + %dM{{//7:(gsDmDsssDmDDD#0C'||C0D8#&*:#:rxxH^`h`l`lmp`q?r?r$,,STWSXX[\d\h\hil\m[n*o#-$+/a$aG$+(IJ(V%&G '1&D&D$+y'" !" $1 +0		.$ #z'9JJt||667K

6(()!!),X6X$T*
'Z-IHHE*c.&9:;-Z9:		j(	 W$.G$<$w-77MM<zII00INN		$z1W<	,6&E<
  f)+>w			  MM<zII-==G1J>>G3h>>002Fv'-w7**733"
#r   zWait for server terminationc           
         V P                  V4      R,          pTR,          p\        T4      p\	        \
        P
                  ! 4       4      p \
        P                  ! T P                  4        T P                  T4      R,          pTR,          p\        T4      pYt8w  g   Y8w  dg   \        P                  RRP                  T\        T4      34      RP                  T\        T4      34      \
        P
                  ! 4       T,
          4       TR8X  d&   T'       g   \        P                  ! RT,          4      hTR8X  d)   \        P                  R	T4        T P                  T4       \	        \
        P
                  ! 4       4      T,
          T P                  8  d   \        P                   hTpTpEKf    \        P                   d     R# i ; i  \        P                   d     R# i ; i  \        P                   d     R# i ; i)
z&Waits for server to reach termination.r   Nr   r   r    r!   z1Server %s failed to delete and is in ERROR statusSOFT_DELETEDz3Automatically force-deleting soft-deleted server %s)r/   rE   NotFoundr   r0   r1   r>   r@   r<   rA   rB   rC   DeleteErrorExceptionr=   force_delete_serverr2   rF   )	rG   r   ignore_errorr	   rK   rM   rO   rL   rN   s	   &&&      r
   wait_for_server_terminationr^      s   !!),X6 hJ$T*NTYY[!J


6(()	%%i0:D X$T*
'Z-IHHE*c.&9:;-Z9:		j(	 G#L..CiO  N* IIKYW**95 tyy{j(F,@,@@***"
#O    		, ##  s5   F2 .G G* 2G
GG'&G'*HHc           	        V P                   pRp\        \        P                  ! 4       4      p\        \        P                  ! 4       4      V,
          V P                  8  d   V! V4      pRV9   d
   VR,          pVR,          pWB8X  d   R# VP	                  4       R8X  d   \
        P                  ! WR7      hVP	                  4       R8X  d   \
        P                  ! VR7      h\        P                  ! V P                  4       K  R	R
VRVRVRV P                  /,          p\        P                  ! 4       pV'       d   RV: RV: 2p\        P                  ! V4      h)zWaits for an image to reach a given status.

The client should have a show_image(image_id) method to get the image.
The client should also have build_interval and build_timeout attributes.
zAn unknown statusimager   Nkilledimage_idr   error)rc   zImage %(image_id)s failed to reach %(status)s state (current state %(current_status)s) within the required time (%(timeout)s s).rc   current_statusr&   r'   r(   )
show_imager0   r1   r2   lowerr   ImageKilledExceptionAddImageExceptionr>   r@   r   rD   rE   rF   )	rG   rc   r   rf   re   startr`   rU   rV   s	   &&&      r
   wait_for_image_statusrk      s'    ""J(N		E
diik
U
"V%9%9
98$ e'NEx#!X-118SS!W,..AA

6(()	  fnv++	
	
  ((*Fv%w/

"
"7
++r   c           	     ,   . p\        \        P                  ! 4       4      p\        \        P                  ! 4       4      V,
          V P                  8  de   V P                  V4      R,          pV Uu. uF  qfR,          V8w  g   K  VNK  	  ppV'       g   V# \        P                  ! V P
                  4       K  RRVRVRVRV P                  /,          p\        P                  ! 4       pV'       d   RV: RV: 2p\        P                  ! V4      hu upi )	z1Waits for an image tasks to reach a given status.tasksr   zvImage %(image_id)s tasks: %(pending_tasks)s failed to reach %(status)s state within the required time (%(timeout)s s).rc   pending_tasksr&   r'   r(   )
r0   r1   r2   show_image_tasksr>   r@   r   rD   rE   rF   )	rG   rc   r   rn   rj   rm   taskrU   rV   s	   &&&      r
   wait_for_image_tasks_statusrq      s    M		E
diik
U
"V%9%9
9''1':*/L%$>V3K%LL

6(()	  ]fv++	
	
  ((*Fv%w/

"
"7
++' Ms   1DDc                    \        \        P                  ! 4       4      p\        \        P                  ! 4       4      V,
          V P                  8  dD   V P                  V4      pVR ,          V8X  d   V# \        P                  ! V P
                  4       Kw  RRVR VRV P                  /,          p\        P                  ! 4       pV'       d   RV: RV: 2p\        P                  ! V4      h)r   zbTask %(task_id)s tasks: failed to reach %(status)s state within the required time (%(timeout)s s).task_idr&   r'   r(   )
r0   r1   r2   
show_tasksr>   r@   r   rD   rE   rF   )rG   rs   r   rj   rp   rU   rV   s   &&&    r
   wait_for_tasks_statusru     s    		E
diik
U
"V%9%9
9  )>V#K

6(()	  gxF<P<P
Q	R  ((*Fv%w/

"
"7
++r   c                   \         P                  p\        \        P                  ! 4       4      p V P	                  4       R,          pRP                  \        V Uu. uFK  pVP                  R4      R8w  g   K  V'       d    VR,          VP                  R4      9   g   KB  VR,          NKM  	  up4      4      p\        \        P                  ! 4       4      V,
          V P                  8  d~   V P                  V4      pVR,          R	8X  d   Ve   VR,          V8X  d   R# VP                  R
4      '       d   \         P                  pM"\        P                  ! V P                  4       K  RV: R\        XP                  R
4      4      : 2p\         P"                  ! 4       p	V	'       d   RV	: RV: 2pV! V4      hu upi   \         P                   d    Te   \         P                  ! R4      h EL9i ; i)zWaits for an image to be imported to all requested stores.

Short circuits to fail if the serer reports failure of any store.
If stores is None, just wait for status==active.

The client should also have build_interval and build_timeout attributes.
stores,z	read-onlytrueidNzGImage service has no store support; cowardly refusing to wait for them.r   activeos_glance_failed_importImage z failed to import on stores: r'   r(   )rE   rF   r0   r1   info_storesrB   sortedr   splitrZ   r2   rf   OtherRestClientExceptionr>   r@   rC   r   rD   )
rG   rc   rw   exc_clsrj   
store_infostorer`   rU   rV   s
   &&&       r
   !wait_for_image_imported_to_storesr   (  s    &&G		E'')(3
 ",!+yy-7   $uT{fll36G'G  E$KK!+	
, diik
U
"V%9%9
9!!(+?h&NeHo799.//66G

6(() 	EII/01G ((*Fv%w/
'
O  
 **6  
s5   +F> F98F9 F9F9,F> 9F> >/G10G1c                p   \        \        P                  ! 4       4      p. p\        \        P                  ! 4       4      V,
          V P                  8  d   V P                  V4      pVP	                  R4      pVe   V'       g
   VR,          # VR,          P                  4       R8X  d   \        P                  ! WR,          R7      h\        P                  ! V P                  4       K  RV: R\        V4      : 2p\        P                  ! 4       pV'       d   RV: R	V: 2p\        P                  ! V4      h)
zWaits for an image to be copied on all requested stores.

The client should also have build_interval and build_timeout attributes.
This return the list of stores where copy is failed.
os_glance_importing_to_storesr|   r   ra   rb   r}   z0 failed to finish the copy operation on stores: r'   r(   )r0   r1   r2   rf   r   rg   r   rh   r>   r@   rC   r   rD   rE   rF   )rG   rc   rj   
store_leftr`   rU   rV   s   &&     r
   wait_for_image_copied_to_storesr   d  s     		EJ
diik
U
"V%9%9
9!!(+YY>?
 !*233?  "h.11!/  	

6(() :  	JG ((*Fv%w/

"
"7
++r   c           
     H   \         P                  ! RV P                  4      R,          P                  RR4      p\	        V RV,           4      pV! V4      V,          R,          pV! V4      V,          R,          p\        \        P                  ! 4       4      p	Wr8w  EdK   \        P                  ! V P                  4       V! V4      V,          R,          pVR8X  d   Wr8w  d   \        P                  ! WQR7      hVR	8X  d   VR
8X  d   \        P                  ! VR7      hVR8X  d   Wr8w  d   \        P                  ! VR7      h\        \        P                  ! 4       4      V	,
          V P                  8  g   K  V'       d<   V'       d4   VP                  V4      R,          p
\        P!                  RV RV
 24       V RV RV RV P                   R2p\"        P$                  ! V4      h\        P'                  V RV RV R\        P                  ! 4       V	,
           R24       R# )aC  Waits for a volume resource to reach a given status.

This function is a common function for volume, snapshot and backup
resources. The function extracts the name of the desired resource from
the client class name of the resource.

If server_id and servers_client are provided, dump the console for that
server on failure.
z-(volume|group-snapshot|snapshot|backup|group)-_show_r   namerd   )resource_nameresource_idvolumeerror_restoring)	volume_iderror_extendingoutputzConsole output for z
body=
z(id=z%) failed to reach %s status (current ) within the required time ( s).z
) reached z after waiting for z secondsN)r9   findallresource_typereplacegetattrr0   r1   r>   r@   r   !VolumeResourceBuildErrorExceptionVolumeRestoreErrorExceptionVolumeExtendErrorExceptionr2   get_console_outputr<   r=   rE   rF   rA   )rG   r   r   r   servers_clientr   show_resourceresource_statusresource_display_namerj   console_outputrU   s   &&&&&       r
   wait_for_volume_resource_statusr     s    JJ8&:N:N

'#s
  FGm$;<M#K0?IO)+6}EfM		E

#

6(()'4]CHMg%/*C>>+  H$<M)M88;OO//O4M77+NNtyy{e#v';';;^!/!B!B9!Mh!W		/	{)NCSTU()k]:_`f_g h--3-A-A,B$H  **733HH 
!k]*VHDWX\XaXaXcfkXkWlltur   c                v   \        \        P                  ! 4       4      p V P                  V4      R,          R,          pV Uu. uF  qUR,          V8X  g   K  VNK  	  ppV'       dK   \        P	                  RV^ ,          R,          VV\        P                  ! 4       V,
          4       V^ ,          # \        P
                  ! V P                  4       \        \        P                  ! 4       4      V,
          V P                  8  g   K  RV: RV: RV P                  : R	2p\        P                  ! V4      hu upi )
z>Waits for a volume attachment to be created at a given volume.r   attachmentsr   zMAttachment %s created for volume %s to server %s after waiting for %f secondsattachment_idzFailed to attach volume z to server  within the required time (r   )
r0   r1   show_volumer<   rA   r>   r@   r2   rE   rF   )rG   r   r   rj   r   afoundrU   s   &&&     r
   !wait_for_volume_attachment_creater     s    		E
((3H=mL'GKq[>Y+FKGHH)a)		e# 8O

6(()tyy{e#v';';; i)=)=? 
 **733% Hs   D6D6c                  a \        \        P                  ! 4       4      pV P                  V4      R,          R,          p\        ;QJ d    V3R lV 4       F  '       g   K   RM	  RM! V3R lV 4       4      '       d   \        P                  ! V P
                  4       \        \        P                  ! 4       4      V,
          V P                  8  d0   RS: RV: RV P                  : R	2p\        P                  ! V4      hV P                  V4      R,          R,          pK  \        P                  R
SV\        P                  ! 4       V,
          4       R# )z@Waits for a volume attachment to be removed from a given volume.r   r   c              3   <   <"   T F  pSVR ,          8H  x  K  	  R# 5i)r   Nr   )r   r   r   s   & r
   r   4wait_for_volume_attachment_remove.<locals>.<genexpr>  s     G;amq11;s   TFzFailed to remove attachment z from volume r   r   zAAttachment %s removed from volume %s after waiting for %f secondsN)r0   r1   r   anyr>   r@   r2   rE   rF   r<   rA   )rG   r   r   rj   r   rU   s   &&f   r
   !wait_for_volume_attachment_remover     s    		E$$Y/9-HK
#G;G###G;G
G
G

6(()tyy{e#v';';; !)V-A-AC 
 **733((3H=mLHHN		e	r   c                  a \        \        P                  ! 4       4      p V P                  V4      R,          p\
        ;QJ d    T3R lT 4       F  '       g   K   RM	  RM! T3R lT 4       4      '       d   \        P                  ! T P                  4       \        \        P                  ! 4       4      T,
          T P                  8  pT'       d^   T P                  T4      R,          p\        P                  RY4       RS: R	T: R
T P                  : R2p\        P                  ! T4      h T P                  T4      R,          pEK  R#   \        P                   d     R# i ; i  \        P                   d     R# i ; i)zWaits for a volume to be removed from a given server.

This waiter checks the compute API if the volume attachment is removed.
volumeAttachmentsNc              3   F   <"   T F  qR ,          S8X  g   K  Vx  K  	  R# 5i)volumeIdNr   )r   r   r   s   & r
   r   @wait_for_volume_attachment_remove_from_server.<locals>.<genexpr>  s     N7Z.@I.Mff7s   !
!TFr   zConsole output for %s
body=
%sVolume  failed to detach from server r   z$ s) from the compute API perspective)r0   r1   list_volume_attachmentsrE   rZ   r   r>   r@   r2   r   r<   r=   rF   )rG   r   r   rj   volumesrT   r   rU   s   &&f     r
   -wait_for_volume_attachment_remove_from_serverr     s0   
 		E00;<OP #N7N###N7N
N
N

6(()		$u,0D0DD	#66yA(KNII8)T "+Iv7K7KM 
 **733	44Y?@STG
 1   	(  	 	s#   E 1E* E'&E'*FFc           	     b   V P                  V4      R,          pVR,          pVR,          p\        \        P                  ! 4       4      pVR8w  g   W$9  d   \        P                  ! V P                  4       V P                  V4      R,          pVR,          pVR,          pVR8X  d    RV,          p\
        P                  ! V4      h\        \        P                  ! 4       4      V,
          V P                  8  g   K  RV: RV: R	V: R
V P                  : R2	p\
        P                  ! V4      hR# )z)Waits for a Volume to move to a new host.r   zos-vol-host-attr:hostmigration_statussuccessrd   zvolume %s failed to migrate.r   z failed to migrate to z
 (current r   r   N)	r   r0   r1   r>   r@   rE   TempestExceptionr2   rF   )rG   r   new_hostr	   hostr   rj   rU   s   &&&     r
   wait_for_volume_migrationr   
  s   i(2D'(D./		E i
'8+?

6(()!!),X6+, 23w&4	BG**733tyy{e#v';';; hf.B.BD 
 **733! ,@r   c           	        V P                  V4      R,          pVR,          p\        \        P                  ! 4       4      pWB8w  d   \        P                  ! V P                  4       V P                  V4      R,          pVR,          p\        \        P                  ! 4       4      V,
          V P
                  8  g   K}  RV: RV: RV: RV P
                  : R2	p\        P                  ! V4      hR# )	z-Waits for a Volume to have a new volume type.r   volume_typer    failed to reach z volume type (current r   r   N)r   r0   r1   r>   r@   r2   rE   rF   )rG   r   new_volume_typer	   current_volume_typerj   rU   s   &&&    r
   wait_for_volume_retyper   %  s    i(2D}-		E

0

6(()!!),X6"=1tyy{e#v';';;
 #'((  **733! 1r   c           	     n  aa \        \        P                  ! 4       4      p VR8X  d\   V P                  V4      R,          o\        ;QJ d    V3R lS 4       F  '       g   K   RM	  RM! V3R lS 4       4      '       g   R# MVR8X  d   V P	                  V4      R,          o\        ;QJ d3    VV3R	 l\        ^ \        S4      4       4       F  '       g   K   RM(	  RM$! VV3R	 l\        ^ \        S4      4       4       4      '       g   R# MBVR
8X  d$   V P	                  V4      R,          oS'       g   R# MRp\        P                  ! V4      h\        \        P                  ! 4       4      V,
          V P                  8  d   \        P                  h\        P                  ! V P                  4       EK  )aH  Waits for a qos operations to be completed.

NOTE : operation value is required for  wait_for_qos_operations()
operation = 'qos-key' / 'disassociate' / 'disassociate-all'
args = keys[] when operation = 'qos-key'
args = volume-type-id disassociated when operation = 'disassociate'
args = None when operation = 'disassociate-all'
Tzqos-key-unset	qos_specsc              3   :   <"   T F  qSR ,          9   x  K  	  R# 5i)specsNr   )r   r   r	   s   & r
   r   *wait_for_qos_operations.<locals>.<genexpr>K  s     <td7m+ts   FNdisassociateqos_associationsc              3   J   <"   T F  pSSV,          R ,          9   x  K  	  R# 5i)rz   Nr   )r   iargsr	   s   & r
   r   r   O  s      J6IttAwt},6Is    #zdisassociate-allz4 operation value is either not defined or incorrect.)r0   r1   show_qosr   show_association_qosrangelenrE   UnprocessableEntityr2   rF   r>   r@   )rG   qos_id	operationr   rO   msgr	   s   &&&f  @r
   wait_for_qos_operationsr   >  s9    TYY[!J
'??6*;7D3<t<333<t<<< =.(..v67IJD3JeAs4y6IJ333JeAs4y6IJJJ K,,..v67IJD  IC--c22tyy{j(F,@,@@***

6(()r   c           	         V P                  W4      R,          pVR,          p\        \        P                  ! 4       4      pWS8w  d   \        P                  ! V P                  4       V P                  W4      R,          pVR,          p\        \        P                  ! 4       4      V,
          V P
                  8  pWS8w  g   K  V'       g   K  RV: RV: RV: RV P
                  : R2	p\        P                  ! V4      hV# )z/Waits for an interface to reach a given status.interfaceAttachment
port_state
Interface r   z status (current r   r   )show_interfacer0   r1   r>   r@   r2   rE   rF   )	rG   r   port_idr   r	   interface_statusrj   rT   rU   s	   &&&&     r
   wait_for_interface_statusr   ^  s      45JKDL)		E

$

6(()$$Y89NO-		$u,0D0DD	%)) F$4f6J6JL 
 **733Kr   c                  a aa V VV3R lpV! 4       p\        \        P                  ! 4       4      pRV9  d   \        P                  ! S P                  4       V! 4       pRV9   d   S P	                  SS4      R,          # \        \        P                  ! 4       4      V,
          S P
                  8  pV'       g   K  RV: RS: RS P
                  : R2p\        P                  ! V4      hR# )	z4Waits for an interface to be detached from a server.c                     < SP                  SS4      R ,          P                  R. 4      p V  Uu. uF  pVR,          R8X  g   K  VR,          NK  	  up# u upi )instanceActioneventseventcompute_detach_interfaceresult)show_instance_actionr   )r   r   rG   detach_request_idr   s     r
   _get_detach_event_results<wait_for_interface_detach.<locals>._get_detach_event_resultsy  sk     ,,Y8IJ

#h
 	
  
W~!;; E(OO
 	
 
s   AASuccessr   r   r   r   z s)N)r0   r1   r>   r@   r   r2   rE   rF   )	rG   r   r   r   r   detach_event_resultsrj   rT   rU   s	   ff&f     r
   wait_for_interface_detachr   v  s    
$ 56		E
/
/

6(()8:,,..y:KL   		$u,0D0DD	9 /6y&BVBVX  **733 0r   c                   R p\        \        P                  ! 4       4      p V P                  VR,          4      R,          pV! W!4      pVf   V'       d   R# V'       g   V'       d   V# \        \        P                  ! 4       4      V,
          V P                  8  dD   V'       d   RV: RVR,          : R2pMRV: RVR,          : R2p\        P
                  ! V4      h\        P                  ! V P                  4       K  )	ap  Wait for floating IP association or disassociation.

:param servers_client: The servers client to use when querying the server's
floating IPs.
:param server: The server JSON dict on which to wait.
:param floating_ip: The floating IP JSON dict on which to wait.
:param wait_for_disassociate: Boolean indiating whether to wait for
disassociation instead of association.
c                     VR ,          P                  4        F7  pV F.  pVR,          R8X  g   K  VR,          V R,          8X  g   K*  Vu u # 	  K9  	  R# )	addresseszOS-EXT-IPS:typefloatingaddrfloating_ip_addressN)values)floating_ipr   r   addresss   &&  r
   $_get_floating_ip_in_server_addressesIwait_for_server_floating_ip.<locals>._get_floating_ip_in_server_addresses  sN    ,335I$-.*<;7L+MM"N % 6 r   rz   r   NzFloating ip z$ failed to disassociate from server z	 in time.z! failed to associate with server )r0   r1   r/   r2   rE   rF   r>   r@   )r   r   r   wait_for_disassociater   rO   r   r   s   &&&&    r
   wait_for_server_floating_ipr     s     TYY[!J
++F4L9(C6{K?4$Ntyy{j(N,H,HH$$ #.vd||=  % #.vd||=  **3//

>001r   c                8   \        \        P                  ! 4       4      p\        \        P                  ! 4       4      V,
          V8  d?   \        P                  ! RV ,           4      pV^ 8X  d   R# \        P                  ! V4       Kh  \
        P                  ! 4       h)z'Waits for an address to become pingablez
ping -c 1 N)r0   r1   ossystemr>   rE   rF   )	server_ipr&   intervalrO   responses   &&&  r
   wait_for_pingr    sb    TYY[!J
diik
Z
''
199\I56q=

8

"
"
$$r   c                n   \         P                   ! 4       p\         P                   ! 4       V,
          V P                  8:  dg   V P                  V4      pVR,          R,          P                  4       VP                  4       8X  d   V# \         P                  ! V P
                  4       K  \        P                  h)a  Wait for a port reach a certain status : ["BUILD" | "DOWN" | "ACTIVE"]
:param client: The network client to use when querying the port's
status
:param status: A string to compare the current port status-to.
:param port_id: The uuid of the port we would like queried for status.
portr   )r1   r2   	show_portrg   r>   r@   rE   rF   )rG   r   r   rO   r   s   &&&  r
   wait_for_port_statusr    s{     J
))+

"f&:&:
:!!'*&>(#))+v||~=M

6(()

"
""r   c                   \        \        P                  ! 4       4      p\        \        P                  ! 4       4      V,
          V8  d    V P                  4        R# \        P
                  ! 4       h  \        P                   d     Kj  i ; i)z)Waits for SSH connection to become usableN)r0   r1   validate_authenticationrE   
SSHTimeoutrF   )
ssh_clientr&   rO   s   && r
   wait_for_sshr    si    TYY[!J
diik
Z
''
1	..0 
"
"
$$ !! 		s   
A1 1B
	B
c                   \        \        P                  ! 4       4      p\        \        P                  ! 4       4      V,
          V P                  8  da   VP                  4       pVR,           Uu. uF  qUR,          NK  	  ppV'       d	   W&9   d   V# \        P                  ! V P
                  4       K  RV,          p\        P                  ! 4       pV'       d   RV: RV: 2p\        P                  ! V4      hu upi )zWaits until image is cachedcached_imagesrc   z!Image %s failed to cache in time.r'   r(   )
r0   r1   r2   
list_cacher>   r@   r   rD   rE   rF   )	rG   cache_clientrc   rj   cachingr`   r   rU   rV   s	   &&&      r
   wait_for_cachingr    s    		E
diik
U
"V%9%9
9))+181IJ1I
##1IJh(N

6(()1H<G((*Fv%w/

"
"7
++ Ks   .C9c                `   \         P                   ! 4       p\         P                   ! 4       V,
          V P                  8  d    V P                  W4      # RV: RV P                  : R2p\        P                  ! V4      h  \        P                   d    \         P
                  ! T4        K  i ; i)z,Waits for created object to become availablezObject z, failed to create within the required time (r   )r1   r2   
get_objectrE   rZ   r>   rF   )object_clientcontainer_nameobject_namer  rO   rU   s   &&&&  r
   wait_for_object_creater    s    J
))+

"]%@%@
@	! ++NHH A 	##G 
"
"7
++  	!JJx 	!s   A> >+B-,B-c                p   \         P                   ! 4       p\         P                   ! 4       V,
          V P                  8  d5   \         P                  ! V P                  4        V P	                  V4       K_  \
        P                  ! RV RV P                   R24      h  \
        P                   d     R# i ; i)zHWaits for loadbalancer to reach termination (until not found deleted lb)NLB() failed to delete in timeout())r1   r2   r>   r@   show_lbrE   rZ   rF   )	lb_clientlb_idrO   s   && r
   wait_for_lb_terminationr$    s    J
))+

"Y%<%<
<

9++,	e$ 
"
"
eW293J3J2K1M   		   "B B54B5c                x   \         P                   ! 4       p\         P                  ! ^4       \         P                   ! 4       V,
          V8  d_    V P                  V4      pVP                  R/ 4      P                  R4      pVR8X  d   R# \         P                  ! V P                  4       K  \
        P                  ! RV RV R24      h  \
        P                   d%    \         P                  ! T P                  4        K  \
        P                   d&    \         P                  ! T P                  4        EK  i ; i)zWaits for GSLB instance to be ready (status.status == completed)

After creating or updating an instance, there may be a background job running.
This waiter polls the instance until status.status becomes 'completed'.
r   	completedNGSLB(z$) failed to become ready in timeout(r   )	r1   r>   show_instancer   r@   rE   ConflictrZ   rF   )gslb_clientinstance_idr&   rO   instancer   s   &&&   r
   wait_for_gslb_instance_readyr.  %  s     JJJqM
))+

"W
,	3"00=H\\(B/33H=F$JJ{112 
"
"
}@	K   	3JJ{112 	3JJ{1122	3s$   9C 	 C 5D9 D9!D98D9c                p   \         P                   ! 4       p\         P                   ! 4       V,
          V P                  8  d5   \         P                  ! V P                  4        V P	                  V4       K_  \
        P                  ! RV RV P                   R24      h  \
        P                   d     R# i ; i)zOWaits for GSLB instance to reach termination (until not found deleted instance)Nr(  r  r   )r1   r2   r>   r@   r)  rE   rZ   rF   )r+  r,  rO   s   && r
   wait_for_gslb_terminationr0  A  s    J
))+

"[%>%>
>

;--.	%%k2 
"
"
}:;;T;T:UUVW   		r%  c                   \         P                   ! 4       p\         P                   ! 4       V,
          V P                  8  dC   \         P                  ! V P                  4        V P	                  V4      R,          R,           Km  \
        P                  ! RV RV P                   R24      h  \
        P                   d     R# i ; i)zXWaits for routing gateway to reach termination (until not found deleted routing gateway)r   r   NRouting gateway(r  r   )r1   r2   r>   r@   read_routing_gatewayrE   rZ   rF   )
vpc_clientrouting_gateway_namerO   s   && r
   $wait_for_routing_gateway_terminationr6  O  s    J
))+

"Z%=%=
=

:,,-	++,@A*MfUU 
"
"
/00NzOgOgNhhij   		   "B* *CCc           
        \         P                   ! 4       p\         P                   ! 4       V,
          \        V4      8  dc   \         P                  ! V P                  4       V P	                  V4      R,          pVR,          V8X  g   Kr  VR,          R,          '       d   K  R# \
        P                  ! RV RV R\        V4       R	24      h)
z6Waits for loadbalancer is_running true or false statusr   
is_runningjobis_processingNr  z) failed to reach 'is_running: z' in timeout(r   )r1   r0   r>   r@   show_lb_statusrE   rF   )r"  r#  r9  lb_running_status_timeout_secrO   	lb_statuss   &&&&  r
   wait_for_lb_running_statusr?  ]  s     J
))+

"S)F%G
G

9++,,,U3H=	 l#z1e$_55

"
"
eW3J<}SQnMoLppqr r   c                   \         P                   ! 4       p\         P                   ! 4       V,
          V P                  8  d   \         P                  ! V P                  4       V P	                  V4      R,          p\        V4      ^ 8X  d   V'       g   R# \        V4      ^ 8X  d   V'       d   K  RpV F%  pVR,          V8X  g   K  VR,          V8X  g   K#  Rp M	  V'       d   V'       d   R# V'       d   K  V'       d   K  R# RV R2p	V'       d   V	R	V R
V R2,          p	MV	RV R
V R2,          p	\        P                  ! V	4      h)zr
Waits for loadbalancer's target drain server state through checking
whether it exists or not by get drainservers

conditionsNFrz   hostnameTr  z) failed to wait for until zexist condtion_id(z) & server(z) in drain servers listznot exist condtion_id()r1   r2   r>   r@   list_drain_serversr   rE   rF   )
r"  r#  condition_idrB  check_drainedrO   lb_drain_listfound_target_drainserver	conditionerr_msgs
   &&&&&     r
   !wait_for_lb_realserver_is_drainedrJ  p  s    J
))+

"Y%<%<
<

9++,!44U;LI}"=}"}#( &I,.9Z3HH3T+/( '
 5}%=%=E756G'~[
Jabb+L>XJNeff

"
"7
++r   c                X   \         P                   ! 4       p\         P                   ! 4       V,
          V8  dt   \         P                  ! V4       V P                  V4      R,          R,          pV F6  pVR,           F&  pVR,          V8X  g   K  VR,          '       g   K$    R# 	  K8  	  K  R# )z5Waits for loadbalancer realserver state is 'up' stater   portsrealserversrB  is_upTF)r1   r>   r<  )	r"  r#  real_server_nametime_outr  rO   ports_statusport_statusreal_server_infos	   &&&&&    r
   wait_for_lb_realserver_up_staterT    s     J
))+

"X
-

8 //6x@I'K$/$>$>  %Z04DD(11 %? ( r   c                d   \         P                   ! 4       p\         P                   ! 4       V,
          V P                  8  dK   \         P                  ! V P                  4       V P	                  V4      pVR,          R,          V8X  g   Ks  R# \
        P                  ! RV RV P                   R24      h)z'Waits for routing gateway to be createdr   r   Nr2  ) failed to create in timeout(r   r1   r2   r>   r@   r3  rE   rF   )r4  created_routing_gateway_namerO   read_created_routing_gateways   &&  r
   !wait_for_routing_gateway_creationrZ    s    J
))+

"Z%=%=
=

:,,-'1'F'F((
$ )4V<+, 

"
"
788VWaWoWoVppqr r   c                   \         P                   ! 4       p\         P                   ! 4       V,
          V P                  8  d}   \         P                  ! V P                  4       V P	                  V4      R,          pVR,           Uu. uF  pVR,          R8X  g   K  VNK  	  ppV F  pVR,          R8X  g   K   R# 	  K  \
        P                  ! RV RV P                   R	24      hu upi )
z)Waits for routing gateway to be availabler   rA  type	AvailableTrueNr2  $) failed to be available in timeout(r   rW  )r4  r5  rO   routing_gateway_statusrH  available_conditiondatas   &&     r
   "wait_for_routing_gateway_availablerc    s    J
))+

"Z%=%=
=

:,,-!+!@!@AU!V"
 4LA
A	 K/ IA 	 

 (DH~' ( 
"
"
/00TU_UmUmTnnop 
s   C$C$c                   \         P                   ! 4       p\         P                   ! 4       V,
          V P                  8  dC   \         P                  ! V P                  4        V P	                  V4      R,          R,           Km  \
        P                  ! RV RV P                   R24      h  \
        P                   d     R# i ; i)zRWaits for acl_policy to reach termination (until not found deleted the acl_policy)r   r   Nr2  r  r   )r1   r2   r>   r@   read_acl_policyrE   rZ   rF   )r4  acl_policy_namerO   s   && r
   wait_for_acl_policy_terminationrg    s    J
))+

"Z%=%=
=

:,,-	&&7
CFKK 
"
"
?++I*JbJbIccde   		r7  c                d   \         P                   ! 4       p\         P                   ! 4       V,
          V P                  8  dK   \         P                  ! V P                  4       V P	                  V4      pVR,          R,          V8X  g   Ks  R# \
        P                  ! RV RV P                   R24      h)z"Waits for acl policy to be createdr   r   NzAcl policy(rV  r   )r1   r2   r>   r@   re  rE   rF   )r4  created_acl_policy_namerO   read_created_acl_policys   &&  r
   wait_for_acl_policy_creationrk    s    J
))+

"Z%=%=
=

:,,-","<"<=T"U":.v6:QQ

"
"
-..LZMeMeLffgh r   zWait for function statusc           	     *   Rp\         P                   ! 4       p\         P                   ! 4       V,
          V P                  8  d   \         P                  ! V P                  4       V P	                  V4      pVR8X  d-   VR,          R,          R9  g   VR,          R,          R8w  d   K  VR,          R,          pW28X  g   K  V# R	V R
V RV RV P                   R2	p\
        P                  ! 4       pV'       d	   RV RV 2p\        P                  ! V4      h)z-Waits for a function to reach a given status.initial statusr{   lastOperationr\  statecompleter   phase	Function r    state (current state r   r   r'   r(   )builddeploy)	r1   r2   r>   r@   show_functionr   rD   rE   rF   )rG   function_namer   re   rO   functionrU   rV   s   &&&     r
   wait_for_function_statusry    s    &NJ
))+

"V%9%9
9

6(()''6X)&19LLO,W5C!(+G4#O M?"3F8 <() *%%&d	,  ((*FfXRy)

"
"7
++r   zWait for function terminationc                    V P                  V4      pTR,          R,          p\        \        P                  ! 4       4      p \        P
                  ! T P                  4        T P                  T4      pTR,          R,          pYd8w  d   \        P                  R4       TR8X  d8   T'       g0   \        P                  R4       \        P                  ! RT R24      h\        \        P                  ! 4       4      T,
          T P                  8  d   \        P                  hTpK    \        P                   d     R# i ; i  \        P                   d     R# i ; i)z*Waits for a function to reach termination.Nr   rq  zbPhase transition "{old_phase}" ==> "{function_phase}" after {time.time() - start_time} second wait	unhealthyrr  z+ failed to delete and is in Unhealthy phase)rv  rE   rZ   r0   r1   r>   r@   r<   rA   r[   r2   rF   )rG   rw  r]   r	   	old_phaserO   function_phases   &&&    r
   wait_for_function_terminationr~    s'   ##M2 Xw'ITYY[!J


6(()	''6D h0&HHt [(HHt ..M?*UV  tyy{j(F,@,@@***"	3    		s#   D% #E %D>=D>EEzWait for function endpointc                   \         P                   ! 4       p\         P                   ! 4       V,
          V P                  8  dg   \         P                  ! V P                  4       V P	                  V4      pVP                  R4      pV'       g   Kw  VP                  4       '       g   K  V# RV RV P                   R2p\        P                  ! 4       pV'       d	   RV RV 2p\        P                  ! V4      h)z.Waits for a function endpoint to be available.endpointrr  z2 endpoint not available within the required time (r   r'   r(   )r1   r2   r>   r@   rv  r   stripr   rD   rE   rF   )rG   rw  rO   rx  r  rU   rV   s   &&     r
   wait_for_function_endpointr  -  s     J
))+

"V%9%9
9

6(()''6<<
+8((O M? #%%+%9%9$:$	@  ((*FfXRy)

"
"7
++r   c                   \        \        P                  ! 4       4      p\        \        P                  ! 4       4      V,
          V P                  8  dD   V! V3/ VB pV'       d   RV9   d
   VR,          # \        P                  ! V P                  4       Kw  Rp\
        P                  ! 4       pV'       d	   RV RV 2p\        P                  ! V4      h)zNWaits until logs are available for the specified function or a timeout occurs.logsz9Timeout waiting for logs from function '{function_name}'.r'   r(   )	r0   r1   r2   r>   r@   r   rD   rE   rF   )rG   search_methodrw  kwargsrj   r  rU   rV   s   &&&,    r
    wait_for_function_logs_to_returnr  B  s     		E
diik
U
"V%9%9
9]5f5FdN<

6(()IG((*FfXRy)

"
"7
++r   c                   \        \        P                  ! 4       4      p\        \        P                  ! 4       4      V,
          V P                  8  dL   V P                  V4      pV'       d   VR,          V8  d   V# \        P                  ! V P
                  4       K  RV R2p\        P                  ! 4       pV'       d	   RV RV 2p\        P                  ! V4      h)z[Waits until trigger histories are available for the specified function or a timeout occurs.totalz-Timeout waiting for histories from function 'z'.r'   r(   )
r0   r1   r2   search_trigger_historiesr>   r@   r   rD   rE   rF   )rG   rw  wait_until_countrj   	historiesrU   rV   s   &&&    r
   *wait_for_searching_histories_from_functionr  S  s    		E
diik
U
"V%9%9
933MB	7+/??

6(()=m_BOG((*FfXRy)

"
"7
++r   c                   \         P                   ! 4       p\         P                   ! 4       V,
          V P                  8  dC   \         P                  ! V P                  4        V P	                  V4      R,          R,           Km  \
        P                  ! RV RV P                   R24      h  \
        P                   d     R# i ; i)zPWaits for NAT gateway to reach termination (until not found deleted NAT gateway)r   r   NNAT gateway(r  r   )r1   r2   r>   r@   read_nat_gatewayrE   rZ   rF   )r4  nat_gateway_namerO   s   && r
    wait_for_nat_gateway_terminationr  c      J
))+

"Z%=%=
=

:,,-	''(89*EfMM 
"
"
'((FzG_G_F``ab   		r7  c                d   \         P                   ! 4       p\         P                   ! 4       V,
          V P                  8  dK   \         P                  ! V P                  4       V P	                  V4      pVR,          R,          V8X  g   Ks  R# \
        P                  ! RV RV P                   R24      h)z#Waits for NAT gateway to be createdr   r   Nr  rV  r   )r1   r2   r>   r@   r  rE   rF   )r4  created_nat_gateway_namerO   read_created_nat_gateways   &&  r
   wait_for_nat_gateway_creationr  q      J
))+

"Z%=%=
=

:,,-#-#>#>?W#X #J/7;SS

"
"
/00NzOgOgNhhij r   c                   \         P                   ! 4       p\         P                   ! 4       V,
          V P                  8  d   \         P                  ! V P                  4       V P	                  V4      R,          p\
        ;QJ d#    R VR,           4       F  '       g   K   RM	  RM! R VR,           4       4      '       g   K  R# \        P                  ! RV RV P                   R	24      h)
z%Waits for NAT gateway to be availabler   c              3   Z   "   T F!  pVR ,          R8X  g   K  VR,          R8H  x  K#  	  R# 5i)r\  r]  r   r^  Nr   )r   rH  s   & r
   r   1wait_for_nat_gateway_available.<locals>.<genexpr>  s0      
=	 K/ *Ih6)=s   ++rA  TFNr  r_  r   )r1   r2   r>   r@   r  r   rE   rF   )r4  r  rO   nat_gateway_statuss   &&  r
   wait_for_nat_gateway_availabler  ~  s    J
))+

"Z%=%=
=

:,,-'889IJ8T3 
/=
333 
/=
 
 

 

"
"
'((LZMeMeLffgh r   c                   \         P                   ! 4       p\         P                   ! 4       V,
          V P                  8  dp   \         P                  ! V P                  4       V P	                  V4      pVR,          R,          V8X  g   Ks  VP                  R/ 4      P                  R4      f   K  R# \        P                  ! RV RV P                   R24      h)	z#Waits for reserved IP to be createdr   r   r   r   NzReserved IP(rV  r   )r1   r2   r>   r@   read_reserved_ipr   rE   rF   )r4  created_reserved_ip_namerO   read_created_reserved_ips   &&  r
   wait_for_reserved_ip_creationr    s    J
))+

"Z%=%=
=

:,,-#-#>#>?W#X $Z08<TT(,,Xr:>>yIU

"
"
/00NzOgOgNhhij r   c                   \         P                   ! 4       p\         P                   ! 4       V,
          V P                  8  dC   \         P                  ! V P                  4        V P	                  V4      R,          R,           Km  \
        P                  ! RV RV P                   R24      h  \
        P                   d     R# i ; i)zPWaits for reserved_ip to reach termination (until not found deleted reserved_ip)r   r   NzReserved_ip(r  r   )r1   r2   r>   r@   r  rE   rZ   rF   )r4  reserved_ip_namerO   s   && r
    wait_for_reserved_ip_terminationr    r  r7  c                   \         P                   ! 4       p\         P                   ! 4       V,
          V P                  8  d^   \         P                  ! V P                  4       V P	                  V4      pVP                  R/ 4      P                  R4      pVR9   g   K  R# \        P                  ! RV RV P                   R24      h)zWaits for VPC to be createdr   NVPC(rV  r   PartialActiveActive)r1   r2   r>   r@   read_vpcr   rE   rF   )r4  created_vpc_namerO   read_created_vpcr   s   &&   r
   wait_for_vpc_creationr    s    J
))+

"Z%=%=
=

:,,-%../?@!%%h377A00

"
"
  >z?W?W>XXYZ r   c                   \         P                   ! 4       p\         P                   ! 4       V,
          V P                  8  dC   \         P                  ! V P                  4        V P	                  V4      R,          R,           Km  \
        P                  ! RV RV P                   R24      h  \
        P                   d     R# i ; i)z@Waits for vpc to reach termination (until not found deleted vpc)r   r   Nr  r  r   r1   r2   r>   r@   r  rE   rZ   rF   )r4  vpc_namerO   s   && r
   wait_for_vpc_terminationr    s    J
))+

"Z%=%=
=

:,,-	)*5f== 
"
"
xj6z7O7O6PPQR   		r7  c                d   \         P                   ! 4       p\         P                   ! 4       V,
          V P                  8  dK   \         P                  ! V P                  4       V P	                  V4      pVR,          R,          V8X  g   Ks  R# \
        P                  ! RV RV P                   R24      h)z#Waits for external IP to be createdr   r   NzExternal IP(rV  r   )r1   r2   r>   r@   read_external_iprE   rF   )r4  created_external_ip_namerO   read_created_external_ips   &&  r
   wait_for_external_ip_creationr    r  r   c                H   \         P                   ! 4       p\         P                   ! 4       V,
          V P                  8  d5   \         P                  ! V P                  4        V P	                  V4       K_  \
        P                  ! RV RV P                   R	24      h  \
        P                   dq    T'       de   T P                  T4      R,          pTP                  R/ 4      pTP                  RR4      '       g    R# TP                  RR4      pY9  d    R#  EK   R# i ; i)
zPWaits for external IP to reach termination (until not found deleted external IP)r   labelsz"vpc.lycorp.co.jp/address_locked_byFNr"   External_ip(r  r   )
r1   r2   r>   r@   r  rE   rZ   r  r   rF   )r4  external_ip_namer  rO   attached_rip_metadatar  	locked_bys   &&&    r
    wait_for_external_ip_terminationr    s    J
))+

"Z%=%=
=

:,,-	''(89$ 
"
"
'((FzG_G_F``ab #  	(2(C(CDT(U)% /228R@zz"FNN"JJ'KRP	#4 5 !	s   "B D!9AD!>D! D!c                   \         P                   ! 4       p\         P                   ! 4       V,
          V P                  8  d   \         P                  ! V P                  4       V P	                  V4      pVR,          R,          R	9   g   Ks  VR,          R,          R,          V8X  g   K  VR,          R,          R,          V8X  g   K  R# \
        P                  ! RV RV P                   R24      h)
z0Waits for Flava VPC gateways' replica is updatedr   
natGatewayreadyReplicas
vpcGatewayNr  z) failed to update in timeout(r   r  )r1   r2   r>   r@   r  rE   rF   )r4  r  nat_ready_replicasvpc_ready_replicasrO   read_updated_vpcs   &&&&  r
   #wait_for_vpc_gateways_replica_readyr    s     J
))+

"Z%=%=
=

:,,-%..x8X&x04OO *<8I!" *<8I!" 

"
"
xj >z?W?W>XXYZ r   c                   \         P                   ! 4       p\         P                   ! 4       V,
          V P                  8  dE   \         P                  ! V P                  4        V P	                  V4      R,          pRV9  d   R# Ko  \
        P                  ! RV RV P                   R24      h  \
        P                   d     R# i ; i)z(Waits for detaching network from the VPCspecnetworksNr  z() failed detach all networks in timeout(r   r  )r4  r  rO   vpc_specs   &&  r
    wait_for_detach_network_from_vpcr    s    J
))+

"Z%=%=
=

:,,-	!**84V<H) * 
"
"
xj@AYAY@ZZ[\   		s   "B, ,CCzWait for cluster statusc           	        Rp\         P                   ! 4       p\         P                   ! 4       V,
          V P                  8  dL   \         P                  ! V P                  4       V P	                  V4      pVR,          R,          pW28X  g   Kt  V# RV RV RV RV P                   R2	p\
        P                  ! 4       pV'       d	   R	V R
V 2p\        P                  ! V4      h)z,Waits for a cluster to reach a given status.rm  r   ro  zCluster r   rs  r   r   r'   r(   )	r1   r2   r>   r@   fetch_clusterr   rD   rE   rF   )rG   
cluster_idr   re   rO   clusterrU   rV   s   &&&     r
   wait_for_cluster_statusr    s     &NJ
))+

"V%9%9
9

6(()&&z2 *73#N :,/x 8() *%%&d	,  ((*FfXRy)

"
"7
++r   zWait for cluster terminationc                p   \         P                   ! 4       p\         P                   ! 4       V,
          V P                  8  d5   \         P                  ! V P                  4        V P	                  V4       K_  \
        P                  ! RV RV P                   R24      h  \
        P                   d     R# i ; i)z)Waits for a cluster to reach termination.NzCluster(r  r   )r1   r2   r>   r@   r  rE   rZ   rF   )rG   r  rO   s   && r
   wait_for_cluster_terminationr  6  s     J
))+

"V%9%9
9

6(()	  , 
"
"
:,<V=Q=Q<RRST   		r%  zWait for node pool statusc           	        Rp\         P                   ! 4       p\         P                   ! 4       V,
          V P                  8  dL   \         P                  ! V P                  4       V P	                  W4      pVR,          R,          pWC8X  g   Kt  V# RV RV RV RV P                   R2	p\
        P                  ! 4       pV'       d	   R	V R
V 2p\        P                  ! V4      h)z.Waits for a node pool to reach a given status.rm  r   ro  z
Node pool r   rs  r   r   r'   r(   )	r1   r2   r>   r@   fetch_node_poolr   rD   rE   rF   )	rG   r  node_pool_namer   re   rO   	node_poolrU   rV   s	   &&&&     r
   wait_for_node_pool_statusr  E  s     &NJ
))+

"V%9%9
9

6(()**:F	"8,W5# ^$$5fX >() *%%&d	,  ((*FfXRy)

"
"7
++r   zWait for node pool terminationc                p   \         P                   ! 4       p\         P                   ! 4       V,
          V P                  8  d5   \         P                  ! V P                  4        V P	                  W4       K_  \
        P                  ! RV RV P                   R24      h  \
        P                   d     R# i ; i)z+Waits for a node pool to reach termination.Nz
Node Pool(r  r   )r1   r2   r>   r@   r  rE   rZ   rF   )rG   r  r  rO   s   &&& r
   wait_for_node_pool_terminationr  ^  s     J
))+

"V%9%9
9

6(()	"":> 
"
"
^$$B6CWCWBXXYZ   		r%  zWait for EgressProxy statusc           	        Rp\         P                   ! 4       p\         P                   ! 4       V,
          V P                  8  dL   \         P                  ! V P                  4       V P	                  V4      pVR,          R,          pW28X  g   Kt  V# RV RV RV RV P                   R2	p\
        P                  ! 4       pV'       d	   R	V R
V 2p\        P                  ! V4      h)z.Waits for EgressProxy to reach a given status.rm  r   rq  zEgressProxy r   rs  r   r   r'   r(   )	r1   r2   r>   r@   show_egress_proxyr   rD   rE   rF   )rG   r   r   re   rO   egress_proxyrU   rV   s   &&&     r
   wait_for_egress_proxy_statusr  m  s     &NJ
))+

"V%9%9
9

6(()//5%h/8# tf-fX 6() *%%&d	,  ((*FfXRy)

"
"7
++r   z Wait for EgressProxy terminationc                p   \         P                   ! 4       p\         P                   ! 4       V,
          V P                  8  d5   \         P                  ! V P                  4        V P	                  V4       K_  \
        P                  ! RV RV P                   R24      h  \
        P                   d     R# i ; i)z+Waits for EgressProxy to reach termination.NzEgressProxy(r  r   )r1   r2   r>   r@   r  rE   rZ   rF   )rG   r   rO   s   && r
   !wait_for_egress_proxy_terminationr    s     J
))+

"V%9%9
9

6(()	$$T* 
"
"
tf:6;O;O:PPQR   		r%  z0Wait for Service Account Credentials terminationc                   \         P                   ! 4       p\         P                   ! 4       V,
          V P                  8  dc   \         P                  ! V P                  4       V P	                  4       R,          pV Uu. uF  qDR,          V8X  g   K  VNK  	  up'       d   K  R# \
        P                  ! RV RV P                   R24      hu upi )z;Waits for Service Account Credentials to reach termination.credentialsrz   NzService Account Credentials(r  r   )r1   r2   r>   r@   list_sa_credentialrE   rF   )rG   credential_idrO   r  r   s   &&   r
   #wait_for_sa_credentials_terminationr    s     J
))+

"V%9%9
9

6(()//1-@&C;aD']*B;CC

"
"
&}o5STZThThSiijk  Ds   <C
C
)Tr   TN)Fr   )NN)      )r  )r  )<   )Tih  )T)
   )Mr  r9   r1   allureoslo_logr   loggingconfigsr   testsr   lib.common.utilsr   librE   r3   	getLogger__name__r<   r   steprW   r^   rk   rq   ru   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r  r  r  r$  r.  r0  r6  r?  rJ  rT  rZ  rc  rg  rk  ry  r~  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r   r   r
   <module>r     s   
 	   #   ' %{{!3 %&w$ 'w$t *++$ ,+$\),X,:,&9x,D-`44,!H4642*@0'4T,2^%# 	%,$,8&",J($.
 '(, ),< ,-# .#@ )*, +,(,", 
& 
>*  &', (,0 +, - (), *,0 -. / *+, ,,0 /0 1 ?@ Ar   