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

pyaarlo -u u -p p camera last-thumbnail: raise AttributeError #141

Open
cpina opened this issue Dec 12, 2023 · 2 comments
Open

pyaarlo -u u -p p camera last-thumbnail: raise AttributeError #141

cpina opened this issue Dec 12, 2023 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@cpina
Copy link
Contributor

cpina commented Dec 12, 2023

No Arlo camera in the network or configured (so a strange case). Typing the command and doing nothing else seems raise the exception below.

carles@pinux:~$ pyaarlo -u u -p p camera last-thumbnail
2023-12-12 20:52:04,091:pyaarlo:ERROR: authentication failed
2023-12-12 20:52:08,023:pyaarlo:ERROR: authentication failed
Traceback (most recent call last):
  File "/home/carles/.local/bin/pyaarlo", line 33, in <module>
    sys.exit(load_entry_point('pyaarlo', 'console_scripts', 'pyaarlo')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/pyaarlo/main.py", line 408, in main_func
    cli()
  File "/usr/lib/python3/dist-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/pyaarlo/main.py", line 373, in camera
    for c in ar.cameras:
             ^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/pyaarlo/__init__.py", line 531, in cameras
    return self._cameras
           ^^^^^^^^^^^^^
AttributeError: 'PyArlo' object has no attribute '_cameras'. Did you mean: 'cameras'?
@cpina
Copy link
Contributor Author

cpina commented Dec 12, 2023

Similar with at least list:

carles@pinux:~$ pyaarlo -u u -p p list all
2023-12-12 20:56:41,193:pyaarlo:ERROR: authentication failed
2023-12-12 20:56:45,009:pyaarlo:ERROR: authentication failed
Traceback (most recent call last):
  File "/home/carles/.local/bin/pyaarlo", line 33, in <module>
    sys.exit(load_entry_point('pyaarlo', 'console_scripts', 'pyaarlo')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/pyaarlo/main.py", line 408, in main_func
    cli()
  File "/usr/lib/python3/dist-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/pyaarlo/main.py", line 320, in list
    list_items("bases", ar.base_stations)
                        ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/pyaarlo/__init__.py", line 558, in base_stations
    return self._bases
           ^^^^^^^^^^^
AttributeError: 'PyArlo' object has no attribute '_bases'
carles@pinux:~$ 

Will not add others if they happen :-)

@twrecked
Copy link
Owner

I noticed that after your pull request. The code for login in needs updating to include 2 factor support.

I'll take a run at it this weekend.

@twrecked twrecked self-assigned this Dec 12, 2023
@twrecked twrecked added the bug Something isn't working label Dec 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants