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

AttributeError: 'Job' object has no attribute 'status' #2

Open
aopdal opened this issue Jun 17, 2019 · 2 comments
Open

AttributeError: 'Job' object has no attribute 'status' #2

aopdal opened this issue Jun 17, 2019 · 2 comments

Comments

@aopdal
Copy link

aopdal commented Jun 17, 2019

I'm trying out your ztp-tutorial and getting a error when I tries
the 'Handling jobs with Redis' I get this error:

############################################################
Peer: 192.168.1.4 UDP/52724
File: sample.cfg
Sent Packets: 1
############################################################
ERROR:root:Exception raised when calling _on_close: 'Job' object has no attribute 'status'
Traceback (most recent call last):
File "/opt/ztp/venv/lib/python3.6/site-packages/fbtftp/base_handler.py", line 178, in _close
self._on_close()
File "/opt/ztp/venv/lib/python3.6/site-packages/fbtftp/base_handler.py", line 169, in _on_close
self._stats_callback(self._stats)
File "ztp_tftp.py", line 53, in session_stats
trigger_job(stats.peer[0], stats.file_path)
File "/opt/ztp/app/broker.py", line 12, in trigger_job
if rq_job.status in ['finished', 'failed']:
AttributeError: 'Job' object has no attribute 'status'

The server provides the file (for debug I just did get sample.cfg from a tftp client).

I'm doing this on Ubuntu 18.04.2

@smolit
Copy link

smolit commented Feb 5, 2020

I have the same problem.
I am running this tutorial on Raspbian Linux pi1 4.19.93-v7+.

Do you have an idea how to resolve this?

Thanks
Sebastian

@smolit
Copy link

smolit commented Feb 5, 2020

Surprise, but I found a solution faster than expected! ;-)
It seems that in "rq" the name for the status arguement has changed to "get_status".
So you have to change the code in broker.py from
if rq_job.status in ['finished', 'failed']:
to
if rq_job.get_status in ['finished', 'failed']:

Sebastian

PS: Great tutorial! Thanks a lot for the work, Patrick!

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

2 participants