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

Fix Attribute Error when Metadata is Missing #143

Open
wants to merge 1 commit into
base: stable/yoga-m3
Choose a base branch
from

Conversation

sven-rosenzweig
Copy link
Contributor

In some cases, metadata information (including age) may be missing for an OpenStack ID. Previously, this caused an exception, leading to an aborted sync.

Since the sync is a preventive measure to synchronize objects of a certain age — most likely unchanged from OpenStack's perspective — this commit ensures the process continues even when metadata is absent.

To improve debugging, we now log the resource_type and os_id when metadata is missing.

In some cases, metadata information (including age) may be missing for an OpenStack ID.
Previously, this caused an exception, leading to an aborted sync.

Since the sync is a preventive measure to synchronize objects of a certain age — most
likely unchanged from OpenStack's perspective — this commit ensures the process
continues even when metadata is absent.

To improve debugging, we now log the resource_type and os_id when metadata is missing.

Co-authored-by: Florian Streibelt <[email protected]>
@sven-rosenzweig
Copy link
Contributor Author

With this commit we should get rid of the following exception.

Copy link

github-actions bot commented Feb 7, 2025

Name                                                                      Stmts   Miss  Cover
---------------------------------------------------------------------------------------------
networking_nsxv3/api/rpc.py                                                 233    110    53%
networking_nsxv3/common/config.py                                            16      0   100%
networking_nsxv3/common/constants.py                                         23      0   100%
networking_nsxv3/common/locking.py                                           35     11    69%
networking_nsxv3/common/synchronization.py                                  180     49    73%
networking_nsxv3/db/db.py                                                    94     19    80%
networking_nsxv3/extensions/nsxtoperations.py                               104     40    62%
networking_nsxv3/plugins/ml2/drivers/nsxv3/agent/agent.py                   162     52    68%
networking_nsxv3/plugins/ml2/drivers/nsxv3/agent/cli.py                     299    195    35%
networking_nsxv3/plugins/ml2/drivers/nsxv3/agent/client_nsx.py              187     49    74%
networking_nsxv3/plugins/ml2/drivers/nsxv3/agent/constants_nsx.py             6      0   100%
networking_nsxv3/plugins/ml2/drivers/nsxv3/agent/extensions/firewall.py      27      0   100%
networking_nsxv3/plugins/ml2/drivers/nsxv3/agent/provider.py                169     10    94%
networking_nsxv3/plugins/ml2/drivers/nsxv3/agent/provider_nsx_policy.py     765    113    85%
networking_nsxv3/plugins/ml2/drivers/nsxv3/agent/realization.py             203     33    84%
networking_nsxv3/plugins/ml2/drivers/nsxv3/driver.py                        129     74    43%
networking_nsxv3/prometheus/exporter.py                                      19      5    74%
networking_nsxv3/services/logapi/drivers/nsxv3/driver.py                     41      1    98%
networking_nsxv3/services/qos/drivers/nsxv3/qos.py                           34      4    88%
networking_nsxv3/services/trunk/drivers/nsxv3/trunk.py                       71      3    96%
---------------------------------------------------------------------------------------------
TOTAL                                                                      2797    768    73%

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 this pull request may close these issues.

3 participants