utils.sw.install gives int() argument must be a string, a bytes-like object or a number, not 'NoneType'
See original GitHub issueI am trying to upgrade the EX2300 with 48 POE+ switch using below code. I don’t set any time out parameters in install function. Everything is using the default value.
with Device(host=hostname, user=junos_username, passwd=junos_password) as dev:
print("Connecting to {}".format(hostname))
if dev.connected:
print("Device connected")
sw = SW(dev)`
ok = sw.install(
package=firware_update_files,
progress=my_progress,
no_copy=True,
validate=False,
cleanfs=True,
)
I get this exception
192.168.1.2:request-package-checks-pending-install rpc is not supported on given device
192.168.1.2:installing software ... please be patient ...
Traceback (most recent call last):
File "/usr/local/lib/python3.8/dist-packages/jnpr/junos/device.py", line 227, in timeout
self._conn.timeout = int(value)
TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.8/dist-packages/jnpr/junos/decorators.py", line 24, in wrapper
dev.timeout = restore_timeout
File "/usr/local/lib/python3.8/dist-packages/jnpr/junos/device.py", line 229, in timeout
raise RuntimeError(
RuntimeError: could not convert timeout value of None to an integer
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.8/dist-packages/jnpr/junos/device.py", line 227, in timeout
self._conn.timeout = int(value)
TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/..../devel/ros_ws/src/bg_sandbox/juno_config/scripts/juno_update.py", line 62, in <module>
main()
File "/home/..../devel/ros_ws/src/bg_sandbox/juno_config/scripts/juno_update.py", line 37, in main
ok = sw.install(
File "/usr/local/lib/python3.8/dist-packages/jnpr/junos/utils/sw.py", line 990, in install
add_ok = self.pkgadd(
File "/usr/local/lib/python3.8/dist-packages/jnpr/junos/utils/sw.py", line 240, in pkgadd
rsp = self.rpc.request_package_add(**args)
File "/usr/local/lib/python3.8/dist-packages/jnpr/junos/rpcmeta.py", line 364, in _exec_rpc
return self._junos.execute(rpc, **dec_args)
File "/usr/local/lib/python3.8/dist-packages/jnpr/junos/decorators.py", line 76, in wrapper
return function(*args, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/jnpr/junos/decorators.py", line 27, in wrapper
dev.timeout = restore_timeout
File "/usr/local/lib/python3.8/dist-packages/jnpr/junos/device.py", line 229, in timeout
raise RuntimeError(
RuntimeError: could not convert timeout value of None to an integer
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:6
Top Results From Across the Web
TypeError: int() argument must be a string, a bytes-like object ...
int() argument must be a string, a bytes-like object, or a number, not 'NoneType'. According to the error, you can't convert strings type ......
Read more >What does 'int() argument must be a string, a bytes like object ...
The error "int() argument must be a string, a bytes like object or a number, not 'NoneType'. Error saving date" means that the...
Read more >Parsing arguments and building values — Python 3.11.1 ...
This format converts a bytes-like object to a C pointer to a character string; it does not accept Unicode objects. The bytes buffer...
Read more >` TypeError: int() argument must be a string, a bytes-like object ...
I'm currently building a U-net model handling multiple input streams of data with Keras/Tensorflow's Functional API.
Read more >Error Message: "int() argument must be a string, a bytes-like ...
Error Message: "int() argument must be a string, a bytes-like object or a number, not 'NoneType'" · Tags: · error · Fusion 360...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I got the same issue and I had to pass the
conn_open_timeout
parameter to the call toDevice
in my case to fix the issue.It seems to me that the culprit, at least in my case, is this commit https://github.com/Juniper/py-junos-eznc/commit/84fe8c6fe337e2488893126517bf1dd2c1f6edbf because it uses
None
as default value for:that is later used as a value for the
timeout
parameter insideopen()
at line 1312:Thanks @chidanandpujar . I was also getting it from junos salt-proxy when trying to apply a Salt state.