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

Platform framework and detect DSL #204

Merged
merged 24 commits into from
Nov 13, 2017
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
dd0b848
Initial building block for platforms
jquick Oct 13, 2017
b4aac00
Refactor platform classes and deprecate os
jquick Oct 13, 2017
62b9d11
Add basic detect logic
jquick Oct 13, 2017
922a716
Move in linux detect logic
jquick Oct 17, 2017
f7567a7
Add in local detect and more unix checks
jquick Oct 17, 2017
d296abc
Refactor os specifications and some cleaning
jquick Oct 19, 2017
c7ae1a2
Added windows and finalize detect
jquick Oct 20, 2017
ab3a04c
Add dynamic family and platform methods and refactor os specification
jquick Oct 24, 2017
83d4aad
add unit tests and finalize detect logic
jquick Oct 26, 2017
efdab1d
fix lint issues
jquick Oct 26, 2017
6c27336
add unknown fallback incase a platform option is not detected
jquick Oct 26, 2017
aff0d80
Merge branch 'master' into jq/platform_objects
jquick Oct 26, 2017
83e01ab
Merge branch 'master' into jq/platform_objects
jquick Oct 26, 2017
810b3d6
Merge branch 'master' into jq/platform_objects
jquick Oct 30, 2017
7fd444d
add skip empty line on os_release detect
jquick Oct 30, 2017
021e6fd
removed unneeded platform type
jquick Oct 30, 2017
1c50340
fix style issues and clear up logic
jquick Oct 31, 2017
7cc0267
style fixes and wrapped os specifications in a class
jquick Oct 31, 2017
453a51d
move around platform files into more logical spots
jquick Nov 1, 2017
98c10dd
move redhat check to be at the end of the family as a catchall
jquick Nov 1, 2017
64a0ccd
update raspbian detect to also check in os_release
jquick Nov 1, 2017
42e6dff
update suse detect to be case insensitive
jquick Nov 1, 2017
0425afb
add helper comments and refactor transport test
jquick Nov 1, 2017
babc875
update detect logic for solaris and arista
jquick Nov 9, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions lib/train.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
require 'train/options'
require 'train/plugins'
require 'train/errors'
require 'train/platforms'
require 'uri'

module Train
Expand All @@ -16,6 +17,9 @@ module Train
# @param [Array] *args list of arguments for the plugin
# @return [Transport] instance of the new transport or nil
def self.create(name, *args)
# require built in detect platforms at this level so any manual ones will be at the top
require 'train/platforms/detect'

cls = load_transport(name)
cls.new(*args) unless cls.nil?
end
Expand Down
3 changes: 3 additions & 0 deletions lib/train/errors.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,7 @@ class ClientError < ::StandardError; end
# Base exception class for all exceptions that are caused by other failures
# in the transport layer.
class TransportError < ::StandardError; end

# Exception for when no platform can be detected
class PlatformDetectionFailed < ::StandardError; end
end
1 change: 0 additions & 1 deletion lib/train/extras.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

module Train::Extras
require 'train/extras/command_wrapper'
require 'train/extras/os_common'
require 'train/extras/stat'

CommandResult = Struct.new(:stdout, :stderr, :exit_status)
Expand Down
60 changes: 0 additions & 60 deletions lib/train/extras/linux_lsb.rb

This file was deleted.

151 changes: 0 additions & 151 deletions lib/train/extras/os_common.rb

This file was deleted.

34 changes: 0 additions & 34 deletions lib/train/extras/os_detect_arista_eos.rb

This file was deleted.

40 changes: 0 additions & 40 deletions lib/train/extras/os_detect_darwin.rb

This file was deleted.

22 changes: 0 additions & 22 deletions lib/train/extras/os_detect_esx.rb

This file was deleted.

Loading