mirror of
https://github.com/inspec/inspec
synced 2024-11-22 12:43:07 +00:00
Dist branding for plugins/inspec-artifact
Signed-off-by: Artem Sidorenko <artem.sidorenko@t-systems.com>
This commit is contained in:
parent
5a2bf961f8
commit
4c0260aedd
2 changed files with 9 additions and 3 deletions
|
@ -4,10 +4,13 @@ require 'pathname'
|
|||
require 'set'
|
||||
require 'tempfile'
|
||||
require 'yaml'
|
||||
require 'inspec/dist'
|
||||
|
||||
module InspecPlugins
|
||||
module Artifact
|
||||
class Base
|
||||
include Inspec::Dist
|
||||
|
||||
KEY_BITS=2048
|
||||
KEY_ALG=OpenSSL::PKey::RSA
|
||||
|
||||
|
@ -87,7 +90,7 @@ module InspecPlugins
|
|||
p = Pathname.new(path_to_profile)
|
||||
p = p.join('inspec.yml')
|
||||
if not p.exist?
|
||||
raise "#{path_to_profile} doesn't appear to be a valid InSpec profile"
|
||||
raise "#{path_to_profile} doesn't appear to be a valid #{PRODUCT_NAME} profile"
|
||||
end
|
||||
yaml = YAML.load_file(p.to_s)
|
||||
yaml = yaml.to_hash
|
||||
|
@ -101,7 +104,7 @@ module InspecPlugins
|
|||
end
|
||||
rescue => e
|
||||
# rewrap it and pass it up to the CLI
|
||||
raise "Error reading InSpec profile metadata: #{e}"
|
||||
raise "Error reading #{PRODUCT_NAME} profile metadata: #{e}"
|
||||
end
|
||||
|
||||
yaml
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
require_relative 'base'
|
||||
require 'inspec/dist'
|
||||
|
||||
#
|
||||
# Notes:
|
||||
|
@ -72,7 +73,9 @@ require_relative 'base'
|
|||
module InspecPlugins
|
||||
module Artifact
|
||||
class CLI < Inspec.plugin(2, :cli_command)
|
||||
subcommand_desc 'artifact SUBCOMMAND', 'Manage InSpec Artifacts'
|
||||
include Inspec::Dist
|
||||
|
||||
subcommand_desc 'artifact SUBCOMMAND', "Manage #{PRODUCT_NAME} Artifacts"
|
||||
|
||||
desc 'generate', 'Generate a RSA key pair for signing and verification'
|
||||
option :keyname, type: :string, required: true,
|
||||
|
|
Loading…
Reference in a new issue