Skip to content

Commit

Permalink
fixed confd get_running exmaple
Browse files Browse the repository at this point in the history
  • Loading branch information
dgjnpr committed Apr 3, 2017
1 parent f01718f commit b325c5f
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions examples/confd/get-running.rb → examples/confd/get_running.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

#
# This code is used to retrieve the running configuration
# from a Tail-F "confD" NETCONF server, and display the
Expand All @@ -8,20 +10,18 @@

puts "NETCONF v#{Netconf::VERSION}"

login = { :target => 'jeap', :port => 2022,
:username => "admin", :password => "admin" }

Netconf::SSH.new( login ){ |dev|

config = dev.rpc.get_config

puts "Showing users on this device ..."

config.xpath("//users/user").each{|user|
puts "Username: #{user.xpath('name').text}"
}

login = {
target: 'jeap',
port: 2022,
username: 'admin',
password: 'admin'
}

Netconf::SSH.new(login) do |dev|
config = dev.rpc.get_config


puts 'Showing users on this device ...'
config.xpath('//users/user').each do |user|
puts "Username: #{user.xpath('name').text}"
end
end

0 comments on commit b325c5f

Please sign in to comment.