Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

diff? not working as expected #65

Open
TvL2386 opened this issue Feb 16, 2020 · 1 comment
Open

diff? not working as expected #65

TvL2386 opened this issue Feb 16, 2020 · 1 comment

Comments

@TvL2386
Copy link

TvL2386 commented Feb 16, 2020

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# 
@TvL2386
Copy link
Author

TvL2386 commented Feb 27, 2020

seems HEAD has this fixed, but the current released gem has not

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant