Skip to content
This repository was archived by the owner on Sep 12, 2018. It is now read-only.

Commit b863419

Browse files
committed
Fix config handling
Docker-DCO-1.1-Signed-off-by: Sam Alba <[email protected]> (github: samalba)
1 parent 458907c commit b863419

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

docker_registry/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
@app.route('/_ping')
2727
@app.route('/v1/_ping')
2828
def ping():
29-
headers = {'X-Docker-Registry-Standalone': cfg.standalone is not False}
29+
headers = {'X-Docker-Registry-Standalone': cfg.standalone is True}
3030
if cfg.mirroring:
3131
headers['X-Docker-Registry-Standalone'] = 'mirror'
3232
return toolkit.response(headers=headers)

docker_registry/images.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ def get_image_ancestry(image_id, headers):
344344

345345

346346
def check_images_list(image_id):
347-
if cfg.disable_token_auth is True or cfg.standalone is not False:
347+
if cfg.disable_token_auth is True or cfg.standalone is True:
348348
# We enforce the check only when auth is enabled so we have a token.
349349
return True
350350
repository = toolkit.get_repository()

docker_registry/run.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
from .search import * # noqa
2222

2323
cfg = config.load()
24-
if cfg.standalone is not False:
24+
if cfg.standalone is True:
2525
# If standalone mode is enabled (default), load the fake Index routes
2626
from .index import * # noqa
2727

docker_registry/toolkit.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def response(data=None, code=200, headers=None, raw=False):
9999

100100
def validate_parent_access(parent_id):
101101
cfg = config.load()
102-
if cfg.standalone is not False:
102+
if cfg.standalone is True:
103103
return True
104104
auth = _parse_auth_header()
105105
if not auth:
@@ -189,10 +189,10 @@ def _parse_auth_header():
189189

190190

191191
def check_token(args):
192+
logger.debug('args = {0}'.format(args))
192193
cfg = config.load()
193-
if cfg.disable_token_auth is True or cfg.standalone is not False:
194+
if cfg.disable_token_auth is True or cfg.standalone is True:
194195
return True
195-
logger.debug('args = {0}'.format(args))
196196
auth = _parse_auth_header()
197197
if not auth:
198198
return False

0 commit comments

Comments
 (0)