examples/re_upgrade.rb
## simple function to use the Netconf::SSH SCP functionality to
## upload a file to the device and watch the percetage tick by ...

simple function to use the Netconf::SSH SCP functionality to
upload a file to the device and watch the percetage tick by
simple function to use the Netconf :: SSH SCP functionality to upload a file to the device and watch the percetage tick by
def copy_file_to_junos( ndev, file_on_server, file_on_junos )  
  mgr_i = cur_i = 0
  backitup = 8.chr * 4
  ndev.scp.upload!( file_on_server, file_on_junos ) do |ch, name, sent, total|  
    pct = (sent.to_f / total.to_f) * 100
    mgr_i = pct.to_i
    if mgr_i != cur_i
      cur_i = mgr_i
      printf "%4s", cur_i.to_s + "%"
      print backitup
    end    
  end
end
def copy_file_to_junos ( ndev , file_on_server , file_on_junos ) mgr_i = cur_i = 0 backitup = 8 . chr * 4 ndev . scp . upload! ( file_on_server , file_on_junos ) do | ch , name , sent , total | pct = ( sent . to_f / total . to_f ) * 100 mgr_i = pct . to_i if mgr_i != cur_i cur_i = mgr_i printf "%4s" , cur_i . to_s + "%" print backitup end end end
simple function to use the Netconf::SSH SCP functionality to
upload a file to the device and watch the percetage tick by ...
simple function to use the Netconf :: SSH SCP functionality to upload a file to the device and watch the percetage tick by ...
ndev
<not_specific>
file_on_server
<not_specific>
file_on_junos
<not_specific>