This repository was archived by the owner on Mar 13, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 33
diff? not working as expected #65
Copy link
Copy link
Open
Description
Hi, I'm playing around with this library but for some reason diff? is not returning the diff.
I don't get it.
My code is:
require 'pp'
require 'net/netconf/jnpr'
require 'junos-ez/stdlib'
login = {
target: '10.202.255.188',
username: 'tom',
password: 'secret'
}
ndev = Netconf::SSH.new( login )
print "Connecting to device #{login[:target]} ... "
ndev.open
puts "OK!"
Junos::Ez::Provider( ndev )
Junos::Ez::Config::Utils( ndev, :cu )
hostname = "TESTSRX-#{Time.now.strftime('%M%S')}"
puts "Trying to set new hostname: #{hostname}"
ndev.cu.load! content: "set system host-name #{hostname}", format: :set
pp ndev.cu.diff?
pp ndev.cu.commit?
ndev.close
The output is:
$ ruby junos.rb
Connecting to device 10.202.255.188 ... OK!
Trying to set new hostname: TESTSRX-0319
""
true
On the SRX320 I see the following:
tom@BOOTSTRAPPED> show configuration | compare
tom@BOOTSTRAPPED> configure
Entering configuration mode
The configuration has been changed but not committed
[edit]
tom@BOOTSTRAPPED# show | compare
[edit system]
- host-name BOOTSTRAPPED;
+ host-name TESTSRX-0319;
[edit]
tom@BOOTSTRAPPED#
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels