Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

unable to call Junos::Ez::Provider #47

@lucasiglesias

Description

@lucasiglesias

Hi,
I´m having almost the same issue as listed in #37
But already checked to be correctly using 'net/netconf/jnpr'

Here is the script:

    #!/usr/bin/ruby

    require 'pp'
    require 'net/netconf/jnpr'
    require 'junos-ez/stdlib'
    require 'highline/import'

    # Create a hash map to hold login parameters for NetConf session
    login = Hash.new

    # Prompt for system IP, username and password
    login[:target]   = "192.168.108.199"
    login[:username] = ask("username: "){     |a| a.echo = true }

    # Connect to target and start netconf ssh session
    dev = Netconf::SSH.new( login ) 
    dev.open

    Junos::Ez::Provider( dev )

    pp dev.facts.catalog

    dev.close

And here the output:

# ./ruby_ez_1.rb 
username: test
/usr/local/rvm/gems/ruby-2.2.1/gems/net-netconf-0.4.3/lib/net/netconf/rpc.rb:32:in `block (3 levels) in method_missing': undefined method `each' for "show version":String (NoMethodError)
        from /usr/local/rvm/gems/ruby-2.2.1/gems/nokogiri-1.6.7.2/lib/nokogiri/xml/builder.rb:391:in `call'
        from /usr/local/rvm/gems/ruby-2.2.1/gems/nokogiri-1.6.7.2/lib/nokogiri/xml/builder.rb:391:in `insert'
        from /usr/local/rvm/gems/ruby-2.2.1/gems/nokogiri-1.6.7.2/lib/nokogiri/xml/builder.rb:375:in `method_missing'
        from /usr/local/rvm/gems/ruby-2.2.1/gems/net-netconf-0.4.3/lib/net/netconf/rpc.rb:31:in `block (2 levels) in method_missing'
        from /usr/local/rvm/gems/ruby-2.2.1/gems/nokogiri-1.6.7.2/lib/nokogiri/xml/builder.rb:391:in `call'
        from /usr/local/rvm/gems/ruby-2.2.1/gems/nokogiri-1.6.7.2/lib/nokogiri/xml/builder.rb:391:in `insert'
        from /usr/local/rvm/gems/ruby-2.2.1/gems/nokogiri-1.6.7.2/lib/nokogiri/xml/builder.rb:375:in `method_missing'
        from /usr/local/rvm/gems/ruby-2.2.1/gems/net-netconf-0.4.3/lib/net/netconf/rpc.rb:31:in `block in method_missing'
        from /usr/local/rvm/gems/ruby-2.2.1/gems/nokogiri-1.6.7.2/lib/nokogiri/xml/builder.rb:293:in `initialize'
        from /usr/local/rvm/gems/ruby-2.2.1/gems/net-netconf-0.4.3/lib/net/netconf/rpc.rb:30:in `new'
        from /usr/local/rvm/gems/ruby-2.2.1/gems/net-netconf-0.4.3/lib/net/netconf/rpc.rb:30:in `method_missing'
        from /usr/local/rvm/gems/ruby-2.2.1/gems/net-netconf-0.4.3/lib/net/netconf/rpc.rb:65:in `method_missing'
        from /usr/local/rvm/gems/ruby-2.2.1/gems/junos-ez-stdlib-0.1.2/lib/junos-ez/facts/version.rb:22:in `block in <top (required)>'
        from /usr/local/rvm/gems/ruby-2.2.1/gems/junos-ez-stdlib-0.1.2/lib/junos-ez/facts.rb:67:in `block in read!'
        from /usr/local/rvm/gems/ruby-2.2.1/gems/junos-ez-stdlib-0.1.2/lib/junos-ez/facts.rb:64:in `each'
        from /usr/local/rvm/gems/ruby-2.2.1/gems/junos-ez-stdlib-0.1.2/lib/junos-ez/facts.rb:64:in `read!'
        from /usr/local/rvm/gems/ruby-2.2.1/gems/junos-ez-stdlib-0.1.2/lib/junos-ez/facts.rb:16:in `Provider'
        from ./ruby_ez_1.rb:20:in `<main>'

Any ideas?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions