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
fixes #9882 - in case of creation of compute resource without compute profile, show relevant error message #2262
Conversation
This fixes a different issue to #9144 as the ticket description shows it has both a compute profile and attributes - it's probably a dupe of something already fixed. It'd be best to describe what this changes on a new ticket. |
Thanks, though I've fixed the description on the new issue, it said exactly the same as the last one. |
@@ -138,6 +141,15 @@ def inheriting_mac | |||
|
|||
protected | |||
|
|||
def compute_resource_requires_fields | |||
if mac.blank? && (managed? && host && host.managed? && !host.compute? &&!virtual?) |
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't these conditions go in the validation declaration itself above? At the validates :mac
declaration I mean, it looks to me like we're checking almost the same condition twice.
@ping ? |
What is the status? I think a beta customer hit this. |
@@ -148,6 +151,13 @@ def host_managed? | |||
|
|||
protected | |||
|
|||
def compute_resource_requires_fields | |||
if host.compute_resource.present? | |||
host.errors.add(:compute_profile, _("you must specify either compute attributes or a compute profile")) |
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.
Best not to use the second person here, just use a fragment so the full sentence makes more sense, e.g. :compute_attributes, _("is required, or use a compute profile")
(and changed the target since the error is about attributes, a profile is a helper.)
…ut compute profile, show relevant error message
I checked the issue that this PR tries to address and it's not reproducible since the big networking change, we changed the way how we load the mac. The related BZ is caused by something else than interface validation. I recommend closing this PR (will update all issues as well). |
No description provided.