MCPcopy Create free account
hub / github.com/FDio/vpp / cli

Method cli

test/vpp_papi_provider.py:463–479  ·  view source on GitHub ↗

Execute a CLI, calling the before/after hooks appropriately. :param cli: CLI to execute :param strip_ansi_escapes: If true, remove ansi escape sequences from output :returns: CLI output

(self, cli, strip_ansi_escapes: bool = True)

Source from the content-addressed store, hash-verified

461 return r
462
463 def cli(self, cli, strip_ansi_escapes: bool = True):
464 """Execute a CLI, calling the before/after hooks appropriately.
465
466 :param cli: CLI to execute
467 :param strip_ansi_escapes: If true, remove ansi escape sequences from output
468 :returns: CLI output
469
470 """
471 r = self.cli_return_response(cli)
472 if r.retval == -156:
473 raise CliSyntaxError(r.reply)
474 if r.retval != 0:
475 raise CliFailedCommandError(r.reply)
476 if hasattr(r, "reply"):
477 if strip_ansi_escapes:
478 return self.ansi_escape.sub("", r.reply)
479 return r.reply
480
481 def ppcli(self, cli):
482 """Helper method to print CLI command in case of info logging level.

Callers 15

ppcliMethod · 0.95
test_igmp_hostMethod · 0.45
test_igmp_routerMethod · 0.45
test_srv6_usid_srhMethod · 0.45
test_srv6_usidMethod · 0.45
test_srv6_usid_flexMethod · 0.45
get_sflow_counterMethod · 0.45
test_mdata_cliMethod · 0.45
add_vpp_configMethod · 0.45
remove_vpp_configMethod · 0.45

Calls 3

cli_return_responseMethod · 0.95
CliSyntaxErrorClass · 0.90

Tested by 15

test_igmp_hostMethod · 0.36
test_igmp_routerMethod · 0.36
test_srv6_usid_srhMethod · 0.36
test_srv6_usidMethod · 0.36
test_srv6_usid_flexMethod · 0.36
get_sflow_counterMethod · 0.36
test_mdata_cliMethod · 0.36
add_vpp_configMethod · 0.36
remove_vpp_configMethod · 0.36
disable_exporterMethod · 0.36