Skip to content

Commit

Permalink
Clarified an error messages and changed Rubocop parameter.
Browse files Browse the repository at this point in the history
A more meaningful error message than "Cannot calculate the Docker tag for <var>"
Sent unnecessary output in ensure_can_access_dockerd to /dev/null
Increased permitted MethodLength on Rubocop to 15

Fixes #16

Signed-off-by: ZeTopHat <chamilton@suse.com>
  • Loading branch information
ZeTopHat committed Sep 29, 2016
1 parent de5ca41 commit 591ac6c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ AllCops:
- Vagrantfile
- sle2docker.gemspec
- lib/templates/**/*
Metrics/MethodLength:
Max: 15
2 changes: 1 addition & 1 deletion lib/sle2docker/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def version
private

def ensure_can_access_dockerd
output = `docker info`
output = `docker info 2>/dev/null`
raise output if $CHILD_STATUS.exitstatus.nonzero?
end

Expand Down
3 changes: 2 additions & 1 deletion lib/sle2docker/prebuilt_image.rb
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ def compute_repository_and_tag
match = regexp.match(@image_name)
match.nil? &&
raise(DockerTagError,
"Cannot calculate the Docker tag for #{@image_name}")
"Docker image #{@image_name} not found. \
Run sle2docker list to check which docker images are available.")

@repository = "suse/#{match['name']}"
@tag = match['version']
Expand Down

0 comments on commit 591ac6c

Please sign in to comment.