summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2017-12-18 20:43:49 -0800
committerTim Smith <tsmith@chef.io>2017-12-19 12:56:35 -0800
commit64014cb9830b8da7123e01212c5dd3d8fe6617a0 (patch)
tree1ce0493a3ba7136f3e87c28ab08656da538659f6
parent9dc874ef1559cb390d64b4746024ca7c9aa9038a (diff)
downloadchef-yum_repo_cleanup.tar.gz
Fix priority to accept 1-99 not 0-99yum_repo_cleanup
Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--lib/chef/resource/yum_repository.rb2
-rw-r--r--spec/unit/resource/yum_repository_spec.rb1
2 files changed, 2 insertions, 1 deletions
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
diff --git a/spec/unit/resource/yum_repository_spec.rb b/spec/unit/resource/yum_repository_spec.rb
index c3732c2eab..3ff9b85f88 100644
--- a/spec/unit/resource/yum_repository_spec.rb
+++ b/spec/unit/resource/yum_repository_spec.rb
@@ -41,6 +41,7 @@ describe Chef::Resource::YumRepository do
expect { resource.priority "99" }.not_to raise_error(ArgumentError)
expect { resource.priority "1" }.not_to raise_error(ArgumentError)
expect { resource.priority "100" }.to raise_error(ArgumentError)
+ expect { resource.priority "0" }.to raise_error(ArgumentError)
end
it "the failovermethod property accepts 'priority' or 'roundrobin'" do