#NEWLINE# def _check_kitchen( ) : #NEWLINE# #INDENT# 'Checks whether there is a valid Chef repository' #NEWLINE# if ( not os . path . exists ( KITCHEN_DIR ) ) : #NEWLINE# #INDENT# raise RepoError ( "Repo dir doesn't exist at '{0}'" . format ( KITCHEN_DIR ) ) #NEWLINE# #UNINDENT# current_dir = os . getcwd ( ) #NEWLINE# os . chdir ( KITCHEN_DIR ) #NEWLINE# ( in_a_kitchen , missing ) = runner . _check_appliances ( ) #NEWLINE# os . chdir ( current_dir ) #NEWLINE# if ( not in_a_kitchen ) : #NEWLINE# #INDENT# missing_str = ( lambda m : ' and ' . join ( ', ' . join ( m ) . rsplit ( ', ' , 1 ) ) ) #NEWLINE# raise RepoError ( "Couldn't find {0}. " . format ( missing_str ( missing ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( not os . path . exists ( DATA_BAG_PATH ) ) : #NEWLINE# #INDENT# raise RepoError ( "The 'node' data bag has not yet been built" ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return True