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

get_sla_objects skips objects with same name #277

Open
nvmdd opened this issue Sep 8, 2021 · 3 comments
Open

get_sla_objects skips objects with same name #277

nvmdd opened this issue Sep 8, 2021 · 3 comments
Labels

Comments

@nvmdd
Copy link

nvmdd commented Sep 8, 2021

Expected Behavior
.get_sla_objects to return all objects from sla

Current Behavior

returns dictionary of {name:id}. objects with the same name are skipped.

Failure Information (for bugs)

When we have a lot of objects with the same name for example "master" database in mssql_db objects .get_sla_objects appends the results in the dictionary and repeating keys will be overwritten and only objects with unique names get returned.

Steps to Reproduce
have 2 objects with same name, (in my case to containers of an mssql database "master"= within the same SLA.
query .get_sla_objects , only one "master" object will be returned.

@nvmdd nvmdd added the kind-bug label Sep 8, 2021
@nvmdd nvmdd changed the title get_sla_objects skips objects with smae name get_sla_objects skips objects with same name Sep 8, 2021
@kambleakash0
Copy link

kambleakash0 commented Sep 8, 2022

This is happening because it's a dictionary.
The keys will be unique. If you're adding new key-value pair to a dictionary which already has the key, it will just update the existing value for that particular key. That's the nature of dictionary.

@nvmdd
Copy link
Author

nvmdd commented Sep 9, 2022

Well yeah the keys will be unique but you wont be able get them all with this function when you have matching names due to, as you said, nature of dictionary.
I rewrote the function for myself using the ID as key so I could get ALL the objects in the SLA not just the ones with a unique name as key.

@kambleakash0
Copy link

Yes, every time we need to use the custom function as inverting the kay-values mapping will also result in loss of data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants