# Path: lava_dispatcher/logical.py
# class DiagnosticAction(Action):
#     """
#     Base class for actions which are run only if a failure is detected.
#     Diagnostics have no level and are not intended to be added to Pipeline.
#     """
# 
#     section = 'diagnostic'
#     name = "diagnose"
#     description = "action-specific diagnostics in case of failure"
#     summary = "diagnose action failure"
# 
#     @classmethod
#     def trigger(cls):
#         raise NotImplementedError("Define in the subclass: %s" % cls)
# 
#     def run(self, connection, max_end_time, args=None):
#         """
#         Log the requested diagnostic.
#         Raises NotImplementedError if subclass has omitted a trigger classmethod.
#         """
#         self.logger.debug("%s diagnostic triggered.", self.trigger())
#         return connection


from lava_dispatcher.logical import DiagnosticAction
# LAVA Dispatcher is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along
# with this program; if not, see <http://www.gnu.org/licenses>.




class DiagnoseNetwork(DiagnosticAction):
    """
    Reports network information on the dispatcher
    """

    name = "dispatcher-network-issues"
    description = "add information to the job output about the dispatcher network"
    summary = "output IP data on dispatcher"

    @classmethod
    def trigger(cls):
        return "network"

    def run(self, connection, max_end_time, args=None):
        connection = super(DiagnoseNetwork, self).run(connection, max_end_time, args)
        return connection



# Path: lava_dispatcher/logical.py
# class DiagnosticAction(Action):
#     """
#     Base class for actions which are run only if a failure is detected.
#     Diagnostics have no level and are not intended to be added to Pipeline.
#     """
# 
#     section = 'diagnostic'
#     name = "diagnose"
#     description = "action-specific diagnostics in case of failure"
#     summary = "diagnose action failure"
# 
#     @classmethod
#     def trigger(cls):
#         raise NotImplementedError("Define in the subclass: %s" % cls)
# 
#     def run(self, connection, max_end_time, args=None):
#         """
#         Log the requested diagnostic.
#         Raises NotImplementedError if subclass has omitted a trigger classmethod.
#         """
#         self.logger.debug("%s diagnostic triggered.", self.trigger())
#         return connection


# Path: lava_dispatcher/diagnostics.py
from lava_dispatcher.logical import DiagnosticAction

# LAVA Dispatcher is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along
# with this program; if not, see <http://www.gnu.org/licenses>.




class DiagnoseNetwork(DiagnosticAction):
    """
    Reports network information on the dispatcher
    """

    name = "dispatcher-network-issues"
    description = "add information to the job output about the dispatcher network"
    summary = "output IP data on dispatcher"

    @classmethod
    def trigger(cls):
        return "network"

    def run(self, connection, max_end_time, args=None):
        connection = super(DiagnoseNetwork, self).run(connection, max_end_time, args)
        return connection



class DiagnoseTargetNetwork(DiagnosticAction):