Skip to content

Commit

Permalink
Fix config handling
Browse files Browse the repository at this point in the history
Docker-DCO-1.1-Signed-off-by: Sam Alba <sam.alba@gmail.com> (github: samalba)

Docker-DCO-1.1-Signed-off-by: Sam Alba <sam.alba@gmail.com> (github: dmp42)
  • Loading branch information
samalba authored and Mangled Deutz committed Jun 13, 2014
1 parent b6aa61f commit a8016be
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion docker_registry/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
@app.route('/_ping')
@app.route('/v1/_ping')
def ping():
headers = {'X-Docker-Registry-Standalone': cfg.standalone is not False}
headers = {'X-Docker-Registry-Standalone': cfg.standalone is True}
if cfg.mirroring:
headers['X-Docker-Registry-Standalone'] = 'mirror'
return toolkit.response(headers=headers)
Expand Down
2 changes: 1 addition & 1 deletion docker_registry/images.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ def get_image_ancestry(image_id, headers):


def check_images_list(image_id):
if cfg.disable_token_auth is True or cfg.standalone is not False:
if cfg.disable_token_auth is True or cfg.standalone is True:
# We enforce the check only when auth is enabled so we have a token.
return True
repository = toolkit.get_repository()
Expand Down
2 changes: 1 addition & 1 deletion docker_registry/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from .search import * # noqa

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

Expand Down
6 changes: 3 additions & 3 deletions docker_registry/toolkit.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def response(data=None, code=200, headers=None, raw=False):

def validate_parent_access(parent_id):
cfg = config.load()
if cfg.standalone is not False:
if cfg.standalone is True:
return True
auth = _parse_auth_header()
if not auth:
Expand Down Expand Up @@ -191,10 +191,10 @@ def _parse_auth_header():


def check_token(args):
logger.debug('args = {0}'.format(args))
cfg = config.load()
if cfg.disable_token_auth is True or cfg.standalone is not False:
if cfg.disable_token_auth is True or cfg.standalone is True:
return True
logger.debug('args = {0}'.format(args))
auth = _parse_auth_header()
if not auth:
return False
Expand Down

0 comments on commit a8016be

Please sign in to comment.