File tree 1 file changed +11
-5
lines changed 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change 24
24
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25
25
# SUCH DAMAGE.
26
26
#
27
- # This script retrieves entire configuration from a network element via NETCONF
27
+ # This script retrieves entire configuration from a network element via NETCONF
28
28
# prints it out in a "pretty" XML tree.
29
29
30
30
import sys
44
44
parser .add_argument ('--port' , type = int , default = 830 ,
45
45
help = "Specify this if you want a non-default port" )
46
46
args = parser .parse_args ()
47
-
47
+
48
48
m = manager .connect (host = args .host ,
49
49
port = args .port ,
50
50
username = args .username ,
51
51
password = args .password ,
52
52
device_params = {'name' :"csr" })
53
- # Pretty print the XML reply
54
- xmlDom = xml .dom .minidom .parseString ( str ( m .get_config (source = 'running' )))
55
- print xmlDom .toprettyxml ( indent = " " )
56
53
54
+ hostname_filter = '''
55
+ <filter>
56
+ <native xmlns="http://cisco.com/ns/yang/Cisco-IOS-XE-native">
57
+ </native>
58
+ </filter>
59
+ '''
57
60
61
+ # Pretty print the XML reply
62
+ xmlDom = xml .dom .minidom .parseString ( str ( m .get_config ('running' , hostname_filter )))
63
+ print (xmlDom .toprettyxml ( indent = " " ))
You can’t perform that action at this time.
0 commit comments