#NEWLINE# def _check_for_state( self , state , cond ) : #NEWLINE# #INDENT# "Wait for the container to reach the given lifecycle state by executing\n        the corresponding, configured lifecycle checks, taking into account the\n        container state (through _wait_for_status) while the checks wait for\n        the target status to be reached.\n\n        Args:\n            state (string): the target lifecycle state.\n            cond (lambda): a lambda function that takes in the container's\n                status (from inspection) and returns True if it conforms to the\n                target desired lifecycle state.\n        " #NEWLINE# checks = self . container . start_lifecycle_checks ( state ) #NEWLINE# if ( not checks ) : #NEWLINE# #INDENT# return self . _wait_for_status ( cond ) #NEWLINE# #UNINDENT# while ( not checks . ready ( ) ) : #NEWLINE# #INDENT# checks . wait ( 1 ) #NEWLINE# if ( not self . _wait_for_status ( self , retries = 1 ) ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# #UNINDENT# for check in checks . get ( ) : #NEWLINE# #INDENT# if ( not check ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# #UNINDENT# return True