knife-mirror 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +0 -4
- data/lib/chef/knife/mirror.rb +11 -1
- data/lib/knife-mirror/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1c1ce443c7aebf8ad72c144e835178828eb39be6
|
4
|
+
data.tar.gz: 1038e4f000b8c38cb3c1465f104cc2ef3baf383e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a7939d1dff7e649e5a533b5b4664799ce888fadc194d6ce7ecb489e989e361309485b104a388e13eb72a988004d33c77f597da003201c65f58eeb4d2357be97c
|
7
|
+
data.tar.gz: 1c1a7091a71ecada1468d90af6de48a779eb206e55a5b0427aa4e7393e0c12c4d5c0e89119da7bc29b4d4acd7a93d7104b84819109841182f00fda4994533d53
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
# knife-mirror Change log
|
2
2
|
|
3
|
+
## 0.1.1 (2015-09-25)
|
4
|
+
|
5
|
+
- do not show orphaned cookbook count if count = 0
|
6
|
+
- improve get_cookbook_meta: return valid (empty) metadata if endpoint (cookbook) does not exist
|
7
|
+
|
3
8
|
## 0.1.0 (2015-09-23)
|
4
9
|
|
5
10
|
- Initial version (still lots of WIP)
|
@@ -12,3 +17,4 @@
|
|
12
17
|
- configurable delay to ease load on Supermarkets
|
13
18
|
- disable meta data replication, supermarket does not honor it anyways
|
14
19
|
- add some initial docs to readme
|
20
|
+
- switch gpl license I defaulted my repo with, to Apache 2.0
|
data/README.md
CHANGED
@@ -47,10 +47,6 @@ If the requested catagory does not exist, supermarket refuses to accept the cook
|
|
47
47
|
|
48
48
|
So obviously need to revisit that.
|
49
49
|
|
50
|
-
Last minute: Just noticed during some final tests, before releasing this first version; if you attempt a ```knife mirror cookbook all``` or ```knife mirror all``` to an 'empty' new fresh supermarket, things will fail.
|
51
|
-
Please, as a workaround for now, just mirror a recent version for some cookbook first, as in, ```knife mirror apt -t https://supermarket.your.domain.tld```.
|
52
|
-
I'll fix this asap, simply need to add some endpoint checking of course, mea culpa.
|
53
|
-
|
54
50
|
## Requirements
|
55
51
|
|
56
52
|
- You need to have Chef Knife working
|
data/lib/chef/knife/mirror.rb
CHANGED
@@ -25,6 +25,7 @@ class Chef
|
|
25
25
|
category 'mirror'
|
26
26
|
|
27
27
|
deps do
|
28
|
+
require 'chef/cookbook/metadata'
|
28
29
|
require 'chef/cookbook_site_streaming_uploader'
|
29
30
|
end
|
30
31
|
|
@@ -75,7 +76,7 @@ class Chef
|
|
75
76
|
ui.info('Done!')
|
76
77
|
removed, added = universe_diff(private_universe, community_universe)
|
77
78
|
ui.info("We are still missing #{added.size} cookbooks (out of #{community_universe.size}) on our target Supermarket.")
|
78
|
-
ui.info("Though we're not doing anything with these just yet, you should know we have #{removed.size} cookbooks which are no longer present on the Supermarket (source).")
|
79
|
+
ui.info("Though we're not doing anything with these just yet, you should know we have #{removed.size} cookbooks which are no longer present on the Supermarket (source).") if removed.size > 0
|
79
80
|
added.sort.each do |cookbook, versions|
|
80
81
|
ui.info("Mirroring #{versions.size} version(s) for #{cookbook} cookbook:")
|
81
82
|
displayed_before = false
|
@@ -160,6 +161,15 @@ class Chef
|
|
160
161
|
|
161
162
|
def get_cookbook_meta(cookbook = @name_args[0], api_url = "#{config[:supermarket_site]}/api/v1/cookbooks")
|
162
163
|
unauthenticated_get_rest("#{api_url}/#{cookbook}")
|
164
|
+
rescue => e
|
165
|
+
if e.message =~ /404/
|
166
|
+
# Return proper (empty) metadata structure
|
167
|
+
md = Chef::Cookbook::Metadata.new
|
168
|
+
return md.to_hash.merge!('metrics' => { 'downloads' => { 'versions' => {} } })
|
169
|
+
else
|
170
|
+
ui.error("Error during #{cookbook} metadata request (#{e.message}). Increase log verbosity (-VV) for more information.")
|
171
|
+
exit(1)
|
172
|
+
end
|
163
173
|
end
|
164
174
|
|
165
175
|
def cookbook_deprecated?(cookbookmeta)
|
data/lib/knife-mirror/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: knife-mirror
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- G.J. Moed
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-09-
|
11
|
+
date: 2015-09-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: chef
|