@@ -1115,7 +1115,11 @@ def _process_pipe(cmd, txt):
1115
1115
)
1116
1116
)
1117
1117
raw_txt = self .device .cli (safe_command , warning = False )
1118
- cli_output [str (command )] = str (_process_pipe (command , raw_txt ))
1118
+ if isinstance (raw_txt , etree ._Element ):
1119
+ raw_txt = etree .tostring (raw_txt .get_parent ()).decode ()
1120
+ cli_output [str (command )] = raw_txt
1121
+ else :
1122
+ cli_output [str (command )] = str (_process_pipe (command , raw_txt ))
1119
1123
return cli_output
1120
1124
1121
1125
def get_bgp_config (self , group = "" , neighbor = "" ):
@@ -2061,6 +2065,7 @@ def ping(
2061
2065
size = C .PING_SIZE ,
2062
2066
count = C .PING_COUNT ,
2063
2067
vrf = C .PING_VRF ,
2068
+ source_interface = C .PING_SOURCE_INTERFACE ,
2064
2069
):
2065
2070
2066
2071
ping_dict = {}
@@ -2071,6 +2076,7 @@ def ping(
2071
2076
size_str = ""
2072
2077
count_str = ""
2073
2078
vrf_str = ""
2079
+ source_interface_str = ""
2074
2080
2075
2081
if source :
2076
2082
source_str = " source {source}" .format (source = source )
@@ -2084,17 +2090,22 @@ def ping(
2084
2090
count_str = " count {count}" .format (count = count )
2085
2091
if vrf :
2086
2092
vrf_str = " routing-instance {vrf}" .format (vrf = vrf )
2093
+ if source_interface :
2094
+ source_interface_str = " interface {source_interface}" .format (
2095
+ source_interface = source_interface
2096
+ )
2087
2097
2088
2098
ping_command = (
2089
- "ping {destination}{source}{ttl}{timeout}{size}{count}{vrf}" .format (
2090
- destination = destination ,
2091
- source = source_str ,
2092
- ttl = maxttl_str ,
2093
- timeout = timeout_str ,
2094
- size = size_str ,
2095
- count = count_str ,
2096
- vrf = vrf_str ,
2097
- )
2099
+ "ping {destination}{source}{ttl}{timeout}{size}{count}{vrf}{source_interface}"
2100
+ ).format (
2101
+ destination = destination ,
2102
+ source = source_str ,
2103
+ ttl = maxttl_str ,
2104
+ timeout = timeout_str ,
2105
+ size = size_str ,
2106
+ count = count_str ,
2107
+ vrf = vrf_str ,
2108
+ source_interface = source_interface_str ,
2098
2109
)
2099
2110
2100
2111
ping_rpc = E ("command" , ping_command )
0 commit comments