Skip to content
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

Merged

Conversation

gmcculloug
Copy link
Member

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.

Remove legacy provision naming code.
Copy link
Member

@chrisarcand chrisarcand left a 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...

@@ -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
Copy link
Member

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?

Copy link
Member Author

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

Copy link
Member

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 gmcculloug changed the title Remove legacy naming code from provisioning [WIP] Remove legacy naming code from provisioning Oct 19, 2017
@gmcculloug gmcculloug added the wip label Oct 19, 2017
@chessbyte
Copy link
Member

@gmcculloug this brings back memories from almost a decade ago!

@gmcculloug gmcculloug force-pushed the remove_legacy_provision_naming branch from bfda4e7 to 0a0c980 Compare October 19, 2017 21:56
@miq-bot
Copy link
Member

miq-bot commented Oct 19, 2017

Checked commits gmcculloug/manageiq@e5e142c~...0a0c980 with ruby 2.3.3, rubocop 0.47.1, and haml-lint 0.20.0
3 files checked, 0 offenses detected
Everything looks fine. 🏆

@gmcculloug gmcculloug removed the wip label Oct 19, 2017
@gmcculloug gmcculloug changed the title [WIP] Remove legacy naming code from provisioning Remove legacy naming code from provisioning Oct 19, 2017
@chrisarcand chrisarcand merged commit 8636cc7 into ManageIQ:master Oct 20, 2017
@chrisarcand chrisarcand added this to the Sprint 72 Ending Oct 30, 2017 milestone Oct 20, 2017
@jrafanie
Copy link
Member

✂️ 🔥 ✂️ 🔥 ✂️ 🔥

🍰 🍪 👏 🙇 😍 🎉

simaishi pushed a commit that referenced this pull request Jan 29, 2018
@simaishi
Copy link
Contributor

This PR is needed in Fine branch to take a blocker PR #16897.

Fine backport details:

$ git log -1
commit 2896f2ccba8b43c03e504459bbc8fa1722c1060d
Author: Chris Arcand <chrisarcand@users.noreply.github.com>
Date:   Fri Oct 20 10:15:54 2017 -0500

    Merge pull request #16237 from gmcculloug/remove_legacy_provision_naming
    
    Remove legacy naming code from provisioning
    (cherry picked from commit 8636cc7006ff16d7d85e518121c637558afd7f01)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1539752

d-m-u pushed a commit to d-m-u/manageiq that referenced this pull request Jun 6, 2018
…sion_naming

Remove legacy naming code from provisioning
(cherry picked from commit 8636cc7)

https://bugzilla.redhat.com/show_bug.cgi?id=1539752
@gmcculloug gmcculloug deleted the remove_legacy_provision_naming branch January 1, 2020 23:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants