-
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
Look for resources in the same region as the selected template during provisioning. #13045
Conversation
@@ -1328,8 +1328,12 @@ def get_pxe_server | |||
PxeServer.find_by(:id => get_value(@values[:pxe_server_id])) | |||
end | |||
|
|||
def get_template |
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.
Use the get_source_vm
method instead. Note that in the case of service catalog items this can return a nil
value.
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.
get_source_vm
returns result in MiqHashStruct instead of AR Object.
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.
Use load_ar_obj
to convert MiqHashStruct or AR.
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.
Overall, the approach looks great. Just have a few questions / comments.
:id => other_region_id, | ||
:pxe_image_type => pxe_image_type) | ||
|
||
allow(workflow).to receive(:supports_native_clone?).and_return(true) |
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.
Shouldn't this be an expect
?
:pxe_image_type => pxe_image_type) | ||
|
||
allow(workflow).to receive(:supports_native_clone?).and_return(true) | ||
expect(workflow.allowed_customization_templates.size).to eq(1) |
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.
I think it would be better for this to match_array
to verify that we end up with the correct template.
@@ -1328,8 +1328,12 @@ def get_pxe_server | |||
PxeServer.find_by(:id => get_value(@values[:pxe_server_id])) | |||
end | |||
|
|||
def get_template |
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.
Can we call this source
? In the subclasses it is not always a VmOrTemplate
@@ -1328,8 +1328,12 @@ def get_pxe_server | |||
PxeServer.find_by(:id => get_value(@values[:pxe_server_id])) | |||
end | |||
|
|||
def get_template | |||
VmOrTemplate.find_by(:id => get_value(@values[:src_vm_id])) |
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.
Should this be hard coded to VmOrTemplate
?
e887bbc
to
57c3155
Compare
ebd8e78
to
4b045b1
Compare
…on during provisioning. Only check for resources in the same region where the selected template locates. https://bugzilla.redhat.com/show_bug.cgi?id=1400991
4b045b1
to
6c9058a
Compare
Checked commit lfu@6c9058a with ruby 2.2.5, rubocop 0.37.2, and haml-lint 0.16.1 |
@gmcculloug Can this PR be merged? |
Changes brought about in ManageIQ#13045 prevented this value from populating in the way expected. It appears that in order for the provision workflow to populate this value now, it must find the source vm/template, which needs to be supplied in the options when you create the provision request.
With the merging of ManageIQ#13045, this spec was failing because the provision workflow failed to find the source. Adding the id to the options when creating the provision request appears to fix it.
Look for resources in the same region as the selected template during provisioning. (cherry picked from commit a25bb6c) https://bugzilla.redhat.com/show_bug.cgi?id=1414886
Euwe backport details:
|
Check tags, Pxe server and cloud init customization templates in the same region as the template.
Links
https://bugzilla.redhat.com/show_bug.cgi?id=1400991
Steps for Testing/QA
Central admin should be enabled for the two remote regions.
Don't create anything in the global region which should be just the replication of remotes.
cc @gmcculloug @bdunne