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

(FM-8081) Add DeviceShim template too #253

Merged
merged 1 commit into from
May 30, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
15 changes: 15 additions & 0 deletions object_templates/transport_device.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
require 'puppet/resource_api/transport/wrapper'

# Initialize the NetworkDevice module if necessary
module Puppet::Util::NetworkDevice; end

# The <%= name.capitalize %> module only contains the Device class to bridge from puppet's internals to the Transport.
# All the heavy lifting is done bye the Puppet::ResourceApi::Transport::Wrapper
module Puppet::Util::NetworkDevice::<%= name.capitalize %> # rubocop:disable Style/ClassAndModuleCamelCase
# Bridging from puppet to the <%= name %> transport
class Device < Puppet::ResourceApi::Transport::Wrapper
def initialize(url_or_config, _options = {})
super('<%= name %>', url_or_config)
end
end
end
2 changes: 1 addition & 1 deletion object_templates/transport_type.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ require 'puppet/resource_api'

Puppet::ResourceApi.register_transport(
name: '<%= name %>',
docs: <<-EOS,
desc: <<-EOS,
This transport provides Puppet with the capability to connect to <%= name %> targets.
EOS
features: [],
Expand Down