diff options
author | Vivek Singh <vivek.singh@msystechnologies.com> | 2019-10-15 05:21:52 +0530 |
---|---|---|
committer | Vivek Singh <vivek.singh@msystechnologies.com> | 2019-10-15 05:21:52 +0530 |
commit | 2f8e934cb814ed937068386219ad2b799e27d96b (patch) | |
tree | 53ce8cd91b7a017c45cbe632ee2ef08c52a4c279 /lib/chef | |
parent | c545db565160ba5c0970fde827304bbb1cc125c9 (diff) | |
download | chef-2f8e934cb814ed937068386219ad2b799e27d96b.tar.gz |
Increase items count to avoid pagination
Signed-off-by: Vivek Singh <vivek.singh@msystechnologies.com>
Diffstat (limited to 'lib/chef')
-rw-r--r-- | lib/chef/knife/supermarket_list.rb | 3 | ||||
-rw-r--r-- | lib/chef/knife/supermarket_search.rb | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/lib/chef/knife/supermarket_list.rb b/lib/chef/knife/supermarket_list.rb index c379ea56c9..ec57830b00 100644 --- a/lib/chef/knife/supermarket_list.rb +++ b/lib/chef/knife/supermarket_list.rb @@ -55,7 +55,8 @@ class Chef end end - def get_cookbook_list(items = 1000, start = 0, cookbook_collection = {}) + # In order to avoid pagination items limit set to 9999999 + def get_cookbook_list(items = 9999999, start = 0, cookbook_collection = {}) cookbooks_url = "#{config[:supermarket_site]}/api/v1/cookbooks?items=#{items}&start=#{start}" cookbooks_url << "&order=#{config[:sort_by]}" if config[:sort_by] cookbooks_url << "&user=#{config[:owned_by]}" if config[:owned_by] diff --git a/lib/chef/knife/supermarket_search.rb b/lib/chef/knife/supermarket_search.rb index 152effba28..f3a57d872a 100644 --- a/lib/chef/knife/supermarket_search.rb +++ b/lib/chef/knife/supermarket_search.rb @@ -35,7 +35,8 @@ class Chef output(search_cookbook(name_args[0])) end - def search_cookbook(query, items = 1000, start = 0, cookbook_collection = {}) + # In order to avoid pagination items limit set to 9999999 + def search_cookbook(query, items = 9999999, start = 0, cookbook_collection = {}) cookbooks_url = "#{config[:supermarket_site]}/api/v1/search?q=#{query}&items=#{items}&start=#{start}" cr = noauth_rest.get(cookbooks_url) cr["items"].each do |cookbook| |