refactor: split main driver file into focused modules#235
Merged
Conversation
Resolves #24 - the main openstack.rb driver file had grown too large with too many concerns in a single class. Extract four new modules from Kitchen::Driver::Openstack: - Config (openstack/config.rb): server naming logic including config_server_name, default_name, and server_name_prefix - Networking (openstack/networking.rb): floating IP allocation and IP address resolution including attach_ip, attach_ip_from_pool, get_ip, get_public_private_ips, filter_ips, and parse_ips - ServerHelper (openstack/server_helper.rb): server creation and resource finders including create_server, init_configuration, optional_config, find_image, find_flavor, find_network, and find_matching - Helpers (openstack/helpers.rb): ohai hints, SSL validation, and server wait logic including add_ohai_hint, disable_ssl_validation, wait_for_server, and countdown The main openstack.rb retains the class definition, create/destroy lifecycle methods, Fog connection helpers, and default_config declarations. Additional changes: - Fix Style/ClassVars offenses by replacing class variables with constants (IP_POOL_LOCK in Networking, DEFAULT_CREATION_TIMEOUT in Volume) - Fix Style/FileRead by using File.read and updating the corresponding spec mock - Remove obsolete --chefstyle flag from Rakefile (no longer supported by newer RuboCop; .rubocop.yml already loads cookstyle via require) - Auto-correct all cookstyle offenses (string quoting, comment format, percent literal delimiters) - Add Lance Albertson as author and Oregon State University copyright Signed-off-by: Lance Albertson <lance@osuosl.org>
Update Rakefile to use 'cookstyle --chefstyle' instead of
RuboCop::RakeTask with the unsupported --chefstyle flag. The
--chefstyle flag is handled by the cookstyle binary, not by RuboCop
directly.
Remove the require directive from .rubocop.yml since --chefstyle
handles config loading internally.
Auto-correct all chefstyle offenses (double-quoted strings,
%i{} delimiters).
Signed-off-by: Lance Albertson <lance@osuosl.org>
Signed-off-by: Lance Albertson <lance@osuosl.org>
e7b7ac9 to
7ff3ec5
Compare
Contributor
|
It's good to see this plugin still is humming along. 🫡 |
Stromweld
previously approved these changes
Apr 3, 2026
Contributor
Stromweld
left a comment
There was a problem hiding this comment.
LGTM, Only recommendation would be to change copilot-instructions to AGENTS.md file and put it in the root directory. This just makes it more universal for all agent types. Contents don't need to be changed.
https://agents.md/
Signed-off-by: Lance Albertson <lance@osuosl.org>
Stromweld
approved these changes
Apr 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #24 - the main openstack.rb driver file had grown too large
with too many concerns in a single class.
Extract four new modules from Kitchen::Driver::Openstack:
config_server_name, default_name, and server_name_prefix
address resolution including attach_ip, attach_ip_from_pool, get_ip,
get_public_private_ips, filter_ips, and parse_ips
resource finders including create_server, init_configuration,
optional_config, find_image, find_flavor, find_network, and
find_matching
server wait logic including add_ohai_hint, disable_ssl_validation,
wait_for_server, and countdown
The main openstack.rb retains the class definition, create/destroy
lifecycle methods, Fog connection helpers, and default_config
declarations.
Additional changes:
constants (IP_POOL_LOCK in Networking, DEFAULT_CREATION_TIMEOUT
in Volume)
spec mock
by newer RuboCop; .rubocop.yml already loads cookstyle via require)
percent literal delimiters)
Signed-off-by: Lance Albertson lance@osuosl.org
Description
Please describe what this change achieves
Issues Resolved
List any existing issues this PR resolves, or any Discourse or
StackOverflow discussions that are relevant
Type of Change
Our release process assumes you are using Conventional Commit messages.
The most important prefixes you should have in mind are:
_fix_: which represents bug fixes, and correlates to a SemVer patch._feat_: which represents a new feature, and correlates to a SemVer minor._feat!_:, orfix!:,refactor!:, etc., which represent a breaking change (indicated by the !) and will result in a major version change.If you have not included a conventional commit message this can be fixed on merge.
Check List