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

UnboundLocalError: cannot access local variable 'ecc_location' where it is not associated with a value #236

Closed
shawaj opened this issue Apr 2, 2023 · 0 comments · Fixed by #237

Comments

@shawaj
Copy link
Member

shawaj commented Apr 2, 2023

This is the error:


<diagnostics> 2023-04-02 07:09:39,337 - [ERROR] - hm_pyhelper.miner_param - (ecc_diagnostic.py).perform_test -- /opt/python-dependencies/hw_diag/diagnostics/ecc_diagnostic.py:(43) - cannot access local variable 'ecc_location' where it is not associated with a value

<diagnostics> Traceback (most recent call last):

<diagnostics>   File "/opt/python-dependencies/hw_diag/diagnostics/ecc_diagnostic.py", line 21, in perform_test

<diagnostics>     ecc_tests = get_gateway_mfr_test_result()

<diagnostics>                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

<diagnostics>   File "/opt/python-dependencies/hm_pyhelper/miner_param.py", line 207, in get_gateway_mfr_test_result

<diagnostics>     return run_gateway_mfr("test")

<diagnostics>            ^^^^^^^^^^^^^^^^^^^^^^^

<diagnostics>   File "/opt/python-dependencies/hm_pyhelper/lock_singleton.py", line 71, in wrapper_lock_ecc

<diagnostics>     raise ex

<diagnostics>   File "/opt/python-dependencies/hm_pyhelper/lock_singleton.py", line 60, in wrapper_lock_ecc

<diagnostics>     raise ex

<diagnostics>   File "/opt/python-dependencies/hm_pyhelper/lock_singleton.py", line 57, in wrapper_lock_ecc

<diagnostics>     value = func(*args, **kwargs)

<diagnostics>             ^^^^^^^^^^^^^^^^^^^^^

<diagnostics>   File "/opt/python-dependencies/hm_pyhelper/miner_param.py", line 32, in run_gateway_mfr

<diagnostics>     command = get_gateway_mfr_command(sub_command, slot=slot)

<diagnostics>               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

<diagnostics>   File "/opt/python-dependencies/hm_pyhelper/miner_param.py", line 167, in get_gateway_mfr_command

<diagnostics>     get_ecc_location()

<diagnostics>   File "/opt/python-dependencies/hm_pyhelper/miner_param.py", line 150, in get_ecc_location

<diagnostics>     if not ecc_location:

<diagnostics>            ^^^^^^^^^^^^

<diagnostics> UnboundLocalError: cannot access local variable 'ecc_location' where it is not associated with a value

<diagnostics> ERROR:hm_pyhelper.miner_param:cannot access local variable 'ecc_location' where it is not associated with a value

<diagnostics> Traceback (most recent call last):

<diagnostics>   File "/opt/python-dependencies/hw_diag/diagnostics/ecc_diagnostic.py", line 21, in perform_test

<diagnostics>     ecc_tests = get_gateway_mfr_test_result()

<diagnostics>                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

<diagnostics>   File "/opt/python-dependencies/hm_pyhelper/miner_param.py", line 207, in get_gateway_mfr_test_result

<diagnostics>     return run_gateway_mfr("test")

<diagnostics>            ^^^^^^^^^^^^^^^^^^^^^^^

<diagnostics>   File "/opt/python-dependencies/hm_pyhelper/lock_singleton.py", line 71, in wrapper_lock_ecc

<diagnostics>     raise ex

<diagnostics>   File "/opt/python-dependencies/hm_pyhelper/lock_singleton.py", line 60, in wrapper_lock_ecc

<diagnostics>     raise ex

<diagnostics>   File "/opt/python-dependencies/hm_pyhelper/lock_singleton.py", line 57, in wrapper_lock_ecc

<diagnostics>     value = func(*args, **kwargs)

<diagnostics>             ^^^^^^^^^^^^^^^^^^^^^

<diagnostics>   File "/opt/python-dependencies/hm_pyhelper/miner_param.py", line 32, in run_gateway_mfr

<diagnostics>     command = get_gateway_mfr_command(sub_command, slot=slot)

<diagnostics>               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

<diagnostics>   File "/opt/python-dependencies/hm_pyhelper/miner_param.py", line 167, in get_gateway_mfr_command

<diagnostics>     get_ecc_location()

<diagnostics>   File "/opt/python-dependencies/hm_pyhelper/miner_param.py", line 150, in get_ecc_location

<diagnostics>     if not ecc_location:

<diagnostics>            ^^^^^^^^^^^^

<diagnostics> UnboundLocalError: cannot access local variable 'ecc_location' where it is not associated with a value

Ref NebraLtd/helium-syncrobit#2 (comment)

shawaj added a commit that referenced this issue Apr 2, 2023
missing ecc_location causes unbound error

Closes: #236
shawaj added a commit that referenced this issue Apr 7, 2023
* fix: missing ecc_location causes unbound error

missing ecc_location causes unbound error

Closes: #236

* Update miner_param.py

* Update setup.py

* Update test_miner_param.py

* Update test_miner_param.py

* Update miner_param.py
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

Successfully merging a pull request may close this issue.

1 participant