chef-zero 3.1.2 → 3.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: adbe4fdeea51156a8ca4c962db7d52502377726f
4
- data.tar.gz: c62f0e6611983ea46a3c65f4c8afd608fa44da48
3
+ metadata.gz: 0ba30ee9950ff65e5d772c7e2092063f4916067a
4
+ data.tar.gz: 2361f6ad62e82e24969f4a70fbf475b9be6ae873
5
5
  SHA512:
6
- metadata.gz: 1f29a803c8a6692e7a9a868d76d9391776812fbb31fc2ff0d0779918b61c9108f7be26f3fecae2b636e9c6da61d906baa55b4654fefdb28f52544a4db6cd7084
7
- data.tar.gz: 84d70a227925b452a248c3d2c76456957c89bbdebf7483753a5671e96aebf1a0be24862d5fe5faf16420fb98edc8fd76b29d92af11838215ef79ce1da7ab4025
6
+ metadata.gz: 68d6b4736a6eeb9ba697baf1296eb5cf9f456f0ed292bb7b6cc21e23288ea9f99a40d9548091f1a96a892f998dcdb351b3910c150dd5adbf71d58a8f0bf80e09
7
+ data.tar.gz: 72e592a0a6b2f4eda33b02f5b8d08080ec536c9d80aac5992d826804614390d6d498399b05d4a55381becde2124c3ef9e12dd1f043c4458ab33c378b2bbe5f60
@@ -38,7 +38,16 @@ module ChefZero
38
38
  def get(path, request=nil)
39
39
  raise DataNotFoundError.new(path) if skip_organizations?(path)
40
40
  fix_exceptions do
41
- real_store.get(path[2..-1], request)
41
+ # Make it so build_uri will include /organizations/ORG inside the V1 data store
42
+ if request && request.rest_base_prefix.size == 0
43
+ old_base_uri = request.base_uri
44
+ request.base_uri = File.join(request.base_uri, 'organizations', single_org)
45
+ end
46
+ begin
47
+ real_store.get(path[2..-1], request)
48
+ ensure
49
+ request.base_uri = old_base_uri if request && request.rest_base_prefix.size == 0
50
+ end
42
51
  end
43
52
  end
44
53
 
@@ -3,7 +3,7 @@ require 'chef_zero/rest_base'
3
3
  module ChefZero
4
4
  module Endpoints
5
5
  # The minimum amount of S3 necessary to support cookbook upload/download
6
- # /file_store/FILE
6
+ # /organizations/NAME/file_store/FILE
7
7
  class FileStoreFileEndpoint < RestBase
8
8
  def json_only
9
9
  false
@@ -8,12 +8,16 @@ module ChefZero
8
8
  end
9
9
 
10
10
  attr_reader :env
11
- attr_reader :rest_base_prefix
11
+ attr_accessor :rest_base_prefix
12
12
 
13
13
  def base_uri
14
14
  @base_uri ||= "#{env['rack.url_scheme']}://#{env['HTTP_HOST']}#{env['SCRIPT_NAME']}"
15
15
  end
16
16
 
17
+ def base_uri=(value)
18
+ @base_uri = value
19
+ end
20
+
17
21
  def requestor
18
22
  @env['HTTP_X_OPS_USERID']
19
23
  end
@@ -300,8 +300,8 @@ module ChefZero
300
300
  #
301
301
  def stop(wait = 5)
302
302
  if @running
303
- @server.shutdown
304
- @thread.join(wait)
303
+ @server.shutdown if @server
304
+ @thread.join(wait) if @thread
305
305
  end
306
306
  rescue Timeout::Error
307
307
  if @thread
@@ -1,3 +1,3 @@
1
1
  module ChefZero
2
- VERSION = '3.1.2'
2
+ VERSION = '3.1.3'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef-zero
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.2
4
+ version: 3.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Keiser
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-29 00:00:00.000000000 Z
11
+ date: 2014-09-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mixlib-log