From 9dc874ef1559cb390d64b4746024ca7c9aa9038a Mon Sep 17 00:00:00 2001 From: Tim Smith Date: Mon, 18 Dec 2017 20:43:03 -0800 Subject: Remove the regex from every string property We copied this in from the cookbook and I assume at one point there was a reason for it, but I can't think of one now. Signed-off-by: Tim Smith --- lib/chef/resource/yum_repository.rb | 42 ++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 21 deletions(-) (limited to 'lib/chef/resource') diff --git a/lib/chef/resource/yum_repository.rb b/lib/chef/resource/yum_repository.rb index 012a74908a..5f3d0eed15 100644 --- a/lib/chef/resource/yum_repository.rb +++ b/lib/chef/resource/yum_repository.rb @@ -1,6 +1,6 @@ # # Author:: Thom May () -# Copyright:: Copyright (c) 2016 Chef Software, Inc. +# Copyright:: Copyright (c) 2016-2017 Chef Software, Inc. # License:: Apache License, Version 2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -26,49 +26,49 @@ class Chef # http://linux.die.net/man/5/yum.conf as well as # http://dnf.readthedocs.io/en/latest/conf_ref.html - property :baseurl, [String, Array], regex: /.*/ + property :baseurl, [String, Array] property :clean_headers, [TrueClass, FalseClass], default: false # deprecated property :clean_metadata, [TrueClass, FalseClass], default: true property :cost, String, regex: /^\d+$/ - property :description, String, regex: /.*/, default: "Yum Repository" + property :description, String, default: "Yum Repository" property :enabled, [TrueClass, FalseClass], default: true property :enablegroups, [TrueClass, FalseClass] - property :exclude, String, regex: /.*/ + property :exclude, String property :failovermethod, String, equal_to: %w{priority roundrobin} property :fastestmirror_enabled, [TrueClass, FalseClass] property :gpgcheck, [TrueClass, FalseClass], default: true - property :gpgkey, [String, Array], regex: /.*/ + property :gpgkey, [String, Array] property :http_caching, String, equal_to: %w{packages all none} - property :include_config, String, regex: /.*/ - property :includepkgs, String, regex: /.*/ + property :include_config, String + property :includepkgs, String property :keepalive, [TrueClass, FalseClass] property :make_cache, [TrueClass, FalseClass], default: true property :max_retries, [String, Integer] property :metadata_expire, String, regex: [/^\d+$/, /^\d+[mhd]$/, /never/] - property :metalink, String, regex: /.*/ + property :metalink, String property :mirror_expire, String, regex: [/^\d+$/, /^\d+[mhd]$/] - property :mirrorexpire, String, regex: /.*/ + property :mirrorexpire, String property :mirrorlist_expire, String, regex: [/^\d+$/, /^\d+[mhd]$/] - property :mirrorlist, String, regex: /.*/ + property :mirrorlist, String property :mode, default: "0644" property :options, Hash - property :password, String, regex: /.*/ property :priority, String, regex: /^(\d?[0-9]|[0-9][0-9])$/ - property :proxy_password, String, regex: /.*/ - property :proxy_username, String, regex: /.*/ - property :proxy, String, regex: /.*/ + property :password, String + property :proxy_password, String + property :proxy_username, String + property :proxy, String property :repo_gpgcheck, [TrueClass, FalseClass] property :report_instanceid, [TrueClass, FalseClass] - property :repositoryid, String, regex: /.*/, name_property: true + property :repositoryid, String, name_property: true property :skip_if_unavailable, [TrueClass, FalseClass] - property :source, String, regex: /.*/ - property :sslcacert, String, regex: /.*/ - property :sslclientcert, String, regex: /.*/ - property :sslclientkey, String, regex: /.*/ + property :source, String + property :sslcacert, String + property :sslclientcert, String + property :sslclientkey, String property :sslverify, [TrueClass, FalseClass] - property :timeout, String, regex: /^\d+$/ property :throttle, [String, Integer] - property :username, String, regex: /.*/ + property :timeout, String, regex: /^\d+$/ + property :username, String default_action :create allowed_actions :create, :remove, :makecache, :add, :delete -- cgit v1.2.1 From 64014cb9830b8da7123e01212c5dd3d8fe6617a0 Mon Sep 17 00:00:00 2001 From: Tim Smith Date: Mon, 18 Dec 2017 20:43:49 -0800 Subject: Fix priority to accept 1-99 not 0-99 Signed-off-by: Tim Smith --- lib/chef/resource/yum_repository.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/chef/resource') diff --git a/lib/chef/resource/yum_repository.rb b/lib/chef/resource/yum_repository.rb index 5f3d0eed15..4b927cf43f 100644 --- a/lib/chef/resource/yum_repository.rb +++ b/lib/chef/resource/yum_repository.rb @@ -52,8 +52,8 @@ class Chef property :mirrorlist, String property :mode, default: "0644" property :options, Hash - property :priority, String, regex: /^(\d?[0-9]|[0-9][0-9])$/ property :password, String + property :priority, String, regex: /^(\d?[1-9]|[0-9][0-9])$/ property :proxy_password, String property :proxy_username, String property :proxy, String -- cgit v1.2.1