spotify/pyfg

Timeout on discard_config command executing

Opened this issue · 0 comments

Question about an issue

Hello there, I am facing an issue of timeout using pyfg in fortios driver for napalm integrated in salt. But the problem does seem to come from here.
When trying to discard_config on a fortios device, the channel raise a socket timeout and the operation fails.

I achieved to make this working perfectly just by changing the timeout value
<...>/python2.7/dist-package/pyFG/fortios.py, line 386:

--chan.settimeout(5)
++chan.settimeout(15)

I dont have tried other timeout values but '5 seconds' failed 30 tries over 30 whereas '15 seconds' worked each 5 times I tried.
I seem to be the only having ever faced this issue, so I suppose it could be a problem on my side.
But I don't see for now what it is, so, question is :
do you see from where on my side the problem could come
would it be interesting to do a pr to change the value, or make it a param.
or do i just go away and change it locally

Thanks

traceback

2018-06-12 15:20:03,453 [/usr/lib/python2.7/dist-packages/salt/utils/napalm.pyc     :229 ][ERROR   ][12137] Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/salt/utils/napalm.py", line 167, in call
    out = getattr(napalm_device.get('DRIVER'), method)(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/napalm_fortios/fortios.py", line 142, in discard_config
    self.device.load_config(in_candidate=True)
  File "/usr/local/lib/python2.7/dist-packages/pyFG/fortios.py", line 212, in load_config
    config_text = self.execute_command(command)
  File "/usr/local/lib/python2.7/dist-packages/pyFG/fortios.py", line 151, in execute_command
    for e in error_chan.read():
  File "/usr/local/lib/python2.7/dist-packages/paramiko/file.py", line 193, in read
    new_data = self._read(self._DEFAULT_BUFSIZE)
  File "/usr/local/lib/python2.7/dist-packages/paramiko/channel.py", line 1344, in _read
    def _read(self, size):
  File "/usr/local/lib/python2.7/dist-packages/paramiko/channel.py", line 733, in recv_stderr
    raise socket.timeout()
timeout

version

pyfg: 0.50
paramiko: 2.4.1
Version: FortiGate-60C-POE v5.2.13,build0762,171212 (GA)
Virus-DB: 16.00560(2012-10-19 08:31)
Extended DB: 1.00000(2012-10-17 15:46)
IPS-DB: 5.00555(2014-10-07 01:21)
IPS-ETDB: 0.00000(2001-01-01 00:00)
Serial-Number: FG60CP3W13000001
Botnet DB: 1.00000(2012-05-28 22:51)
BIOS version: 04000003
System Part-Number: P12195-01
Log hard disk: Not available
Internal Switch mode: switch
Hostname: fg60cp3w13000001
Operation Mode: NAT
Current virtual domain: root
Max number of virtual domains: 10
Virtual domains status: 1 in NAT mode, 0 in TP mode
Virtual domain configuration: disable
FIPS-CC mode: disable
Current HA mode: standalone
Branch point: 762
Release Version Information: GA
System time: Tue Jun 12 08:38:03 2018