Beispiel #1
0
    def unset_adj_metric(cli_opts, node, interface, yes):  # noqa: B902
        """
        Unset previously set custom metric value on the node.
        """
        question_str = "Are you sure to unset metric " "for adjacency {} {} ?".format(
            node, interface)
        if not utils.yesno(question_str, yes):
            return

        lm.UnsetAdjMetricCmd(cli_opts).run(node, interface, yes)
        nodes = parse_nodes(cli_opts, "")
        kvstore.ShowAdjNodeCmd(cli_opts).run(nodes, node, interface)
Beispiel #2
0
    def unset_adj_metric(cli_opts, node, interface, yes):  # noqa: B902
        '''
        Unset previously set custom metric value on the node.
        '''
        question_str = 'Are you sure to unset metric ' \
                       'for adjacency {} {} ?'.format(node, interface)
        if not utils.yesno(question_str, yes):
            return

        lm.UnsetAdjMetricCmd(cli_opts).run(node, interface, yes)
        nodes = parse_nodes(cli_opts.host, '', cli_opts.lm_cmd_port)
        kvstore.ShowAdjNodeCmd(cli_opts).run(nodes, node, interface)
Beispiel #3
0
    def set_adj_metric(cli_opts, node, interface, metric, yes):  # noqa: B902
        """
        Set custom metric value for the adjacency
        """
        question_str = "Are you sure to override metric for adjacency {} {} ?".format(
            node, interface)
        if not utils.yesno(question_str, yes):
            return

        lm.SetAdjMetricCmd(cli_opts).run(node, interface, metric, yes)
        nodes = parse_nodes(cli_opts, "")
        kvstore.ShowAdjNodeCmd(cli_opts).run(nodes, node, interface)
Beispiel #4
0
    def set_adj_metric(cli_opts, node, interface, metric, yes):  # noqa: B902
        '''
        Set custom metric value for the adjacency
        '''
        question_str = 'Are you sure to override metric '\
                       'for adjacency {} {} ?'.format(node, interface)
        if not utils.yesno(question_str, yes):
            return

        lm.SetAdjMetricCmd(cli_opts).run(node, interface, metric, yes)
        nodes = parse_nodes(cli_opts.host, '', cli_opts.lm_cmd_port)
        kvstore.ShowAdjNodeCmd(cli_opts).run(nodes, node, interface)