Adjust deprecations somewhat

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
This commit is contained in:
Clinton Wolfe 2019-04-12 10:55:36 -04:00
parent 40031a9b83
commit fc1bc75358
6 changed files with 18 additions and 15 deletions

View file

@ -1,6 +1,6 @@
{
"file_version": "1.0.0",
"unknown_group_action": "exit",
"unknown_group_action": "ignore",
"groups": {
"attrs_value_replaces_default": {
"action": "ignore",
@ -26,7 +26,8 @@
},
"inspec_ui_methods": {
"action": "ignore",
"suffix": "Please call `cli.ui` directly"
"suffix": "Please call `cli.ui` directly",
"comment": "See #3715"
},
"mssql_session_pass_option": {
"action": "warn",
@ -84,9 +85,8 @@
"action": "warn",
"suffix": "This resource will be removed in InSpec 4.0"
},
"resource_user": {
"action": "warn",
"suffix": "This resource will be removed in InSpec 4.0."
"resource_user_serverspec_compat": {
"action": "warn"
},
"resource_windows_registry_key": {
"action": "warn",
@ -100,6 +100,9 @@
"supports_syntax": {
"action": "warn"
},
"mount_parser_serverspec_compat": {
"action": "warn"
},
"wmi_non_hash_usage": {
"action": "warn",
"suffix": "This property will be removed in InSpec 4.0."

View file

@ -22,7 +22,7 @@ class AwsIamUser < Inspec.resource(1)
alias has_console_password? has_console_password
def name
Inspec.deprecate(:properties_aws_iam_user, 'The aws_iam_users `name` property is deprecated. Please use `username` instead')
Inspec.deprecate(:properties_aws_iam_user, 'The aws_iam_user `name` property is deprecated. Please use `username` instead')
username
end

View file

@ -49,7 +49,7 @@ module Inspec::Resources
@port = params[:port]
if params[:proto]
Inspec.deprecate(:host_resource_proto_usage, 'The host resource `proto` parameter is deprecated. Please use `protocol`.')
Inspec.deprecate(:host_resource_proto_usage, 'The `host` resource `proto` resource parameter is deprecated. Please use `protocol`.')
@protocol = params[:proto]
else
@protocol = params.fetch(:protocol, 'icmp')

View file

@ -28,7 +28,7 @@ module Inspec::Resources
@user = opts[:user]
@password = opts[:password] || opts[:pass]
if opts[:pass]
Inspec.deprecate(:oracaldb_session_pass_option, 'The oracledb_session `pass` option is deprecated. Please use `password`.')
Inspec.deprecate(:oracledb_session_pass_option, 'The oracledb_session `pass` option is deprecated. Please use `password`.')
end
@host = opts[:host] || 'localhost'

View file

@ -213,35 +213,35 @@ module Inspec::Resources
# implement 'mindays' method to be compatible with serverspec
def minimum_days_between_password_change
Inspec.deprecate(:resource_user, 'The user resource `minimum_days_between_password_change` property is deprecated. Please use `mindays`.')
Inspec.deprecate(:resource_user_serverspec_compat, 'The user resource `minimum_days_between_password_change` property is deprecated. Please use `mindays`.')
mindays
end
# implement 'maxdays' method to be compatible with serverspec
def maximum_days_between_password_change
Inspec.deprecate(:resource_user, 'The user resource `maximum_days_between_password_change` property is deprecated. Please use `maxdays`.')
Inspec.deprecate(:resource_user_serverspec_compat, 'The user resource `maximum_days_between_password_change` property is deprecated. Please use `maxdays`.')
maxdays
end
# implements rspec has matcher, to be compatible with serverspec
# @see: https://github.com/rspec/rspec-expectations/blob/master/lib/rspec/matchers/built_in/has.rb
def has_uid?(compare_uid)
Inspec.deprecate(:serverspec_compatibility, 'The user resource `has_uid?` matcher is deprecated.')
Inspec.deprecate(:resource_user_serverspec_compat, 'The user resource `has_uid?` matcher is deprecated.')
uid == compare_uid
end
def has_home_directory?(compare_home)
Inspec.deprecate(:resource_user, 'The user resource `has_home_directory?` matcher is deprecated. Please use `its(\'home\')`.')
Inspec.deprecate(:resource_user_serverspec_compat, 'The user resource `has_home_directory?` matcher is deprecated. Please use `its(\'home\')`.')
home == compare_home
end
def has_login_shell?(compare_shell)
Inspec.deprecate(:resource_user, 'The user resource `has_login_shell?` matcher is deprecated. Please use `its(\'shell\')`.')
Inspec.deprecate(:resource_user_serverspec_compat, 'The user resource `has_login_shell?` matcher is deprecated. Please use `its(\'shell\')`.')
shell == compare_shell
end
def has_authorized_key?(_compare_key)
Inspec.deprecate(:resource_user, 'The user resource `has_authorized_key?` matcher is deprecated. There is no currently implemented alternative')
Inspec.deprecate(:resource_user_serverspec_compat, 'The user resource `has_authorized_key?` matcher is deprecated. There is no currently implemented alternative')
raise NotImplementedError
end

View file

@ -88,7 +88,7 @@ module LinuxMountParser
# parse options as array
mount_options[:options] = mount[5].gsub(/\(|\)/, '').split(',')
else
Inspec.deprecate(:serverspec_compatibility, 'Parsing mount options in this fashion is deprecated')
Inspec.deprecate(:mount_parser_serverspec_compat, 'Parsing mount options in this fashion is deprecated')
mount_options[:options] = {}
mount[5].gsub(/\(|\)/, '').split(',').each do |option|
name, val = option.split('=')