Commit 470abed
committed
refactor: split main driver file into focused modules
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>1 parent 2b35d09 commit 470abed
11 files changed
Lines changed: 509 additions & 363 deletions
File tree
- lib/kitchen/driver
- openstack
- spec/kitchen/driver
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
| 1 | + | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | | - | |
| 18 | + | |
| 19 | + | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
28 | | - | |
| 27 | + | |
| 28 | + | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | | - | |
11 | | - | |
12 | | - | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
13 | 13 | | |
14 | | - | |
15 | | - | |
| 14 | + | |
| 15 | + | |
16 | 16 | | |
17 | | - | |
18 | | - | |
| 17 | + | |
| 18 | + | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | | - | |
23 | | - | |
24 | | - | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
25 | 25 | | |
0 commit comments