summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2017-07-20 14:36:06 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2017-07-20 14:36:06 -0700
commitf0973fc7c597905f786a2fbe6f241cd972c6a336 (patch)
tree43f0b8da9af5d3c92e2862de6880cf674827a935
parent30cc959bde0f00293cd28a77963f12a29b0086df (diff)
downloadchef-f0973fc7c597905f786a2fbe6f241cd972c6a336.tar.gz
chef server rejects metadata with nil maintainer
chef server returns a 400. we could prune nil values out of the JSON but then it'd be difficult to specify a "null" JSON value if we really needed one. seems better to follow the pattern of using empty string here (which i tested against Hosted and works). Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
-rw-r--r--lib/chef/cookbook/metadata.rb4
-rw-r--r--spec/unit/cookbook/metadata_spec.rb6
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/chef/cookbook/metadata.rb b/lib/chef/cookbook/metadata.rb
index 5efadd6f62..b23c01e622 100644
--- a/lib/chef/cookbook/metadata.rb
+++ b/lib/chef/cookbook/metadata.rb
@@ -100,8 +100,8 @@ class Chef
@long_description = ""
@license = "All rights reserved"
- @maintainer = nil
- @maintainer_email = nil
+ @maintainer = ""
+ @maintainer_email = ""
@platforms = Mash.new
@dependencies = Mash.new
diff --git a/spec/unit/cookbook/metadata_spec.rb b/spec/unit/cookbook/metadata_spec.rb
index 2fdc43c289..a91feec26d 100644
--- a/spec/unit/cookbook/metadata_spec.rb
+++ b/spec/unit/cookbook/metadata_spec.rb
@@ -1,7 +1,7 @@
#
# Author:: Adam Jacob (<adam@chef.io>)
# Author:: Seth Falcon (<seth@chef.io>)
-# Copyright:: Copyright 2008-2016, Chef Software, Inc.
+# Copyright:: Copyright 2008-2017, Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -98,11 +98,11 @@ describe Chef::Cookbook::Metadata do
end
it "has an empty maintainer field" do
- expect(metadata.maintainer).to eq(nil)
+ expect(metadata.maintainer).to eq("")
end
it "has an empty maintainer_email field" do
- expect(metadata.maintainer).to eq(nil)
+ expect(metadata.maintainer_email).to eq("")
end
it "has an empty platforms list" do