diff options
-rw-r--r-- | lib/chef/provider/zypper_repository.rb | 10 | ||||
-rw-r--r-- | lib/chef/resource/zypper_repository.rb | 2 |
2 files changed, 3 insertions, 9 deletions
diff --git a/lib/chef/provider/zypper_repository.rb b/lib/chef/provider/zypper_repository.rb index c8f521d081..b5bdbce2d7 100644 --- a/lib/chef/provider/zypper_repository.rb +++ b/lib/chef/provider/zypper_repository.rb @@ -68,15 +68,7 @@ class Chef # zypper repos are allowed to have spaces in the names # @return [String] escaped repo string def escaped_repo_name - Shellwords.escape(new_resource.repo_name) - end - - # return the specified cookbook name or the cookbook containing the - # resource. - # - # @return [String] name of the cookbook - def cookbook_name - new_resource.cookbook || new_resource.cookbook_name + @escaped_repo_name ||= Shellwords.escape(new_resource.repo_name) end # determine if a template file is available in the current run diff --git a/lib/chef/resource/zypper_repository.rb b/lib/chef/resource/zypper_repository.rb index fd4a8e6b36..260ac2adec 100644 --- a/lib/chef/resource/zypper_repository.rb +++ b/lib/chef/resource/zypper_repository.rb @@ -99,6 +99,8 @@ class Chef property :cookbook, String, description: "The cookbook to source the repository template file from. Only necessary if you're not using the built in template.", + default: lazy { cookbook_name }, + default_description: "The cookbook containing the resource", desired_state: false property :gpgautoimportkeys, [TrueClass, FalseClass], |