-
Notifications
You must be signed in to change notification settings - Fork 16
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
Aggregate Mode - group synchronization #276
base: master
Are you sure you want to change the base?
Conversation
dict_asset_groups = {} | ||
for node_asset in node_assets: | ||
groups = [] | ||
if node_asset.groups: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We must check at some point that we do not have assets without hostname
Maybe add node_asset.hostname is not None
to this condition
Or get rid of assets with no hostname directly from the "local_assets" list
PARAMS = { "groups": groups_to_add} | ||
client_aggregate.update_server(str(aggregate_assets_by_hostname_id[asset]),PARAMS) | ||
|
||
# Add missing groups to assets on aggregation node - assets without groups without groups case |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Add missing groups to assets on aggregation node - assets without groups without groups case | |
# Add missing groups to assets on aggregation node - assets without groups case |
for group in dict_asset_groups_local[asset]: | ||
groups_to_add.append(aggregate_groups[group]) | ||
PARAMS = { "groups": groups_to_add} | ||
client_aggregate.update_server(str(aggregate_assets_by_hostname_id[asset]),PARAMS) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After further testing, it is not enough to check that the assets hostname are not None
The script also throws an exception when the hostname is an IP adresse for example.
The str() function probably does not handle this cases well
Can we add a function, that is not necessarily ran by default, add a group that matches the name of the agregated node on assets on the agregation node |
No description provided.