#NEWLINE# @ classmethod #NEWLINE# def _check_repos_connectivity( cls , resp_kwargs , failed_nodes_msg , suggestion_msg = '' ) : #NEWLINE# #INDENT# 'Analyze response data to check repo connectivity from nodes\n\n        :param resp_kwargs: task response data\n        :type resp_kwargs: dict\n        :param failed_nodes_msg: error message part if the task has not\n            due to underlying command execution error; is formatted by\n            node name\n        :type failed_nodes_msg: str\n        :param failed_repos_msg: error message part if connection to the\n            repositories cannot be established; is formatted by list of names\n            of the repositories\n        :type failed_repos_msg: str\n        :param err_msg: general error message part\n        :type err_msg: str\n        ' #NEWLINE# task_uuid = resp_kwargs . get ( 'task_uuid' ) #NEWLINE# response = resp_kwargs . get ( 'nodes' , [ ] ) #NEWLINE# status = consts . TASK_STATUSES . ready #NEWLINE# progress = 100 #NEWLINE# task = objects . Task . get_by_uuid ( task_uuid , fail_if_not_found = True ) #NEWLINE# failed_response_nodes = { n [ 'uid' ] : n for n in response if ( n [ 'status' ] != 0 ) } #NEWLINE# failed_nodes = [ ] #NEWLINE# failed_repos = set ( ) #NEWLINE# master = failed_response_nodes . pop ( consts . MASTER_NODE_UID , None ) #NEWLINE# if ( master is not None ) : #NEWLINE# #INDENT# failed_repos . update ( cls . _get_failed_repos ( master ) ) #NEWLINE# failed_nodes . append ( consts . MASTER_NODE_NAME ) #NEWLINE# #UNINDENT# nodes = objects . NodeCollection . filter_by_list ( None , 'id' , failed_response_nodes , order_by = 'id' ) #NEWLINE# for node in nodes : #NEWLINE# #INDENT# failed_repos . update ( cls . _get_failed_repos ( failed_response_nodes [ node . uid ] ) ) #NEWLINE# failed_nodes . append ( node . name ) #NEWLINE# #UNINDENT# err_msg = '' #NEWLINE# failed_repos_msg = 'Following repos are not available - {0}.\n ' #NEWLINE# if failed_nodes : #NEWLINE# #INDENT# err_msg = failed_nodes_msg . format ( ', ' . join ( failed_nodes ) ) #NEWLINE# #UNINDENT# if failed_repos : #NEWLINE# #INDENT# err_msg += failed_repos_msg . format ( ', ' . join ( failed_repos ) ) #NEWLINE# #UNINDENT# if ( err_msg and suggestion_msg ) : #NEWLINE# #INDENT# err_msg += suggestion_msg #NEWLINE# #UNINDENT# if err_msg : #NEWLINE# #INDENT# status = consts . TASK_STATUSES . error #NEWLINE# #UNINDENT# objects . Task . update_verify_networks ( task , status , progress , err_msg , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } )