-
Notifications
You must be signed in to change notification settings - Fork 896
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
Remove legacy naming code from provisioning #16237
Remove legacy naming code from provisioning #16237
Conversation
Remove legacy provision naming code.
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.
😍 Thanks @gmcculloug !!!! One thing I noticed...
app/models/miq_provision/naming.rb
Outdated
@@ -1,31 +1,20 @@ | |||
module MiqProvision::Naming | |||
extend ActiveSupport::Concern | |||
|
|||
NAME_VIA_AUTOMATE = true | |||
NAME_SEQUENCE_REGEX = /\$n\{(\d+)\}/ | |||
SOURCE_IDENTIFIER = "provisioning" # a unique name for the source column in custom_attributes table | |||
|
|||
module ClassMethods | |||
def get_next_vm_name(prov_obj, determine_index = true) | |||
unresolved_vm_name = nil |
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 don't think you need this assignment anymore either, right?
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.
Correct, I was initially limiting this to just the relevant changes as I am working on another refactoring of this code to support some new functionality.
It was hard to ignore this at the end of the method, but I'll add them if you prefer:
vm_name = get_vm_full_name(unresolved_vm_name, prov_obj, determine_index)
vm_name
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.
Heh, gotcha. I don't mind some cleanup in the same PR (in a separate commit!), but you can do whatever you wish!
@gmcculloug this brings back memories from almost a decade ago! |
bfda4e7
to
0a0c980
Compare
Checked commits gmcculloug/manageiq@e5e142c~...0a0c980 with ruby 2.3.3, rubocop 0.47.1, and haml-lint 0.20.0 |
✂️ 🔥 ✂️ 🔥 ✂️ 🔥 🍰 🍪 👏 🙇 😍 🎉 |
Remove legacy naming code from provisioning (cherry picked from commit 8636cc7) https://bugzilla.redhat.com/show_bug.cgi?id=1539752
This PR is needed in Fine branch to take a blocker PR #16897. Fine backport details:
|
…sion_naming Remove legacy naming code from provisioning (cherry picked from commit 8636cc7) https://bugzilla.redhat.com/show_bug.cgi?id=1539752
The initial provisioning naming logic was stored in a file on disk so customers could easily modify it. A long long time ago this logic was moved into automate to better support multi-appliance configurations. (Yeah, that long ago.)
This change also removes a brakeman exception.