-
Notifications
You must be signed in to change notification settings - Fork 897
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
ansible refresh job_template -> playbook connection #14432
ansible refresh job_template -> playbook connection #14432
Conversation
bdc1d2c
to
8deb24e
Compare
@@ -32,6 +32,12 @@ def configuration_scripts | |||
inventory_object.survey_spec = job_template.survey_spec_hash | |||
inventory_object.variables = job_template.extra_vars_hash | |||
inventory_object.inventory_root_group = persister.inventory_root_groups.lazy_find(job_template.inventory_id.to_s) | |||
# inventory_object.configuration_script_source = persister.projects.lazy_find(job_template.project_id.to_s) | |||
# project = persister.configuration_script_sources.lazy_find(job_template.project_id.to_s) | |||
inventory_object.parent = persister.configuration_script_payloads.lazy_find( |
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.
@bzwei this is the right association, right?
job_template.parent = playbook
/ configuration_script.parent = configuration_script_payload
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.
@durandom yes
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.
is the parent using ancestry? If so, it might be best to do a custom saver like I have for AWS. Otherwise it's being saved ineffectively. :-)
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.
no, its just a POA - plain old association
@@ -32,6 +32,12 @@ def configuration_scripts | |||
inventory_object.survey_spec = job_template.survey_spec_hash | |||
inventory_object.variables = job_template.extra_vars_hash | |||
inventory_object.inventory_root_group = persister.inventory_root_groups.lazy_find(job_template.inventory_id.to_s) | |||
# inventory_object.configuration_script_source = persister.projects.lazy_find(job_template.project_id.to_s) | |||
# project = persister.configuration_script_sources.lazy_find(job_template.project_id.to_s) |
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.
@jameswnl cant we store this info too?
job_template.project
/ configuration_script.configuration_script_source
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.
do we need to? because job_template.playbook.project
/ configuration_script.configuration_script_payload.configuration_script_source
is there to provide this info already
@@ -441,7 +441,7 @@ def find(manager_uuid) | |||
when :local_db_find_missing_references | |||
data_index[manager_uuid] || find_in_db(manager_uuid) | |||
else | |||
data_index[manager_uuid] | |||
manager_uuid.kind_of?(Hash) ? find_by(manager_uuid) : data_index[manager_uuid] |
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.
@Ladas I had to do this to make adding lazy_find via a Hash (see the first and last commit in this PR)
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.
hm, and then it just works?
I was thinking about adding a lazy_find_by, so maybe we should rather remove the find_by methods and just check for the Hash in find methods?
8deb24e
to
740b67f
Compare
looks good, the graph refresh change make sense, I'll to some consistency tweaks based on this later. Also having InventoryObject as part of the key will not work using the hash, so that is a thing to fix :-) |
740b67f
to
7b87f44
Compare
7b87f44
to
c9de871
Compare
@miq-bot remove_label wip |
Checked commits durandom/manageiq@b6c481f~...c9de871 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 |
@blomquisg merge? @bzwei and @jameswnl gave their 👍 inline |
@miq-bot add_label fine/yes |
@blomquisg merge? |
…onfiguration_scripts ManageIQ#14432
ansible refresh job_template -> playbook connection (cherry picked from commit e15393a)
Fine backport details:
|
attaches Playbook (ConfigurationScriptPayload) to JobTemplate (ConfigurationScript) via
.parent
during refreshdo what #14419 did in refresh