{"action":"opened","number":1521,"pull_request":{"url":"https://api.github.com/repos/docker/compose/pulls/1521","id":37095509,"html_url":"https://github.com/docker/compose/pull/1521","diff_url":"https://github.com/docker/compose/pull/1521.diff","patch_url":"https://github.com/docker/compose/pull/1521.patch","issue_url":"https://api.github.com/repos/docker/compose/issues/1521","number":1521,"state":"open","locked":false,"title":"Validate that service names passed to Project.containers aren't bogus.","user":{"login":"dano","id":38807,"avatar_url":"https://avatars.githubusercontent.com/u/38807?v=3","gravatar_id":"","url":"https://api.github.com/users/dano","html_url":"https://github.com/dano","followers_url":"https://api.github.com/users/dano/followers","following_url":"https://api.github.com/users/dano/following{/other_user}","gists_url":"https://api.github.com/users/dano/gists{/gist_id}","starred_url":"https://api.github.com/users/dano/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dano/subscriptions","organizations_url":"https://api.github.com/users/dano/orgs","repos_url":"https://api.github.com/users/dano/repos","events_url":"https://api.github.com/users/dano/events{/privacy}","received_events_url":"https://api.github.com/users/dano/received_events","type":"User","site_admin":false},"body":"The `Project.containers` method doesn't validate the list of service names passed to it, which leads to behavior like this:\r\n\r\n```\r\ndan@dandesk:~/test$ sudo docker-compose logs madeupnamesdfg\r\nAttaching to \r\n```\r\nThe invalid service name just gets ignored. This behavior is seen with `ps` and `rm`, in addition to `logs`. However, to be consistent with all the other docker-compose commands, a `NoSuchService` exception should be raised instead.\r\n\r\nWith this patch, the previous example does just that:\r\n```\r\ndan@dandesk:~/test$ sudo docker-compose logs madeupnamesdfg\r\nNo such service: madeupnamesdfg\r\n```\r\nLet me know if this needs a unit test, or if you'd prefer something other than using `get_services` (like a dedicated `validate_service_names` method) to do the validation.\r\n","created_at":"2015-06-06T19:35:00Z","updated_at":"2015-06-06T19:35:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/docker/compose/pulls/1521/commits","review_comments_url":"https://api.github.com/repos/docker/compose/pulls/1521/comments","review_comment_url":"https://api.github.com/repos/docker/compose/pulls/comments{/number}","comments_url":"https://api.github.com/repos/docker/compose/issues/1521/comments","statuses_url":"https://api.github.com/repos/docker/compose/statuses/1dc3a4277332099a97febdeab6b251a881e43d01","head":{"label":"dano:validate-service-names","ref":"validate-service-names","sha":"1dc3a4277332099a97febdeab6b251a881e43d01","user":{"login":"dano","id":38807,"avatar_url":"https://avatars.githubusercontent.com/u/38807?v=3","gravatar_id":"","url":"https://api.github.com/users/dano","html_url":"https://github.com/dano","followers_url":"https://api.github.com/users/dano/followers","following_url":"https://api.github.com/users/dano/following{/other_user}","gists_url":"https://api.github.com/users/dano/gists{/gist_id}","starred_url":"https://api.github.com/users/dano/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dano/subscriptions","organizations_url":"https://api.github.com/users/dano/orgs","repos_url":"https://api.github.com/users/dano/repos","events_url":"https://api.github.com/users/dano/events{/privacy}","received_events_url":"https://api.github.com/users/dano/received_events","type":"User","site_admin":false},"repo":{"id":36991071,"name":"compose","full_name":"dano/compose","owner":{"login":"dano","id":38807,"avatar_url":"https://avatars.githubusercontent.com/u/38807?v=3","gravatar_id":"","url":"https://api.github.com/users/dano","html_url":"https://github.com/dano","followers_url":"https://api.github.com/users/dano/followers","following_url":"https://api.github.com/users/dano/following{/other_user}","gists_url":"https://api.github.com/users/dano/gists{/gist_id}","starred_url":"https://api.github.com/users/dano/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dano/subscriptions","organizations_url":"https://api.github.com/users/dano/orgs","repos_url":"https://api.github.com/users/dano/repos","events_url":"https://api.github.com/users/dano/events{/privacy}","received_events_url":"https://api.github.com/users/dano/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dano/compose","description":"Define and run multi-container applications with Docker","fork":true,"url":"https://api.github.com/repos/dano/compose","forks_url":"https://api.github.com/repos/dano/compose/forks","keys_url":"https://api.github.com/repos/dano/compose/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dano/compose/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dano/compose/teams","hooks_url":"https://api.github.com/repos/dano/compose/hooks","issue_events_url":"https://api.github.com/repos/dano/compose/issues/events{/number}","events_url":"https://api.github.com/repos/dano/compose/events","assignees_url":"https://api.github.com/repos/dano/compose/assignees{/user}","branches_url":"https://api.github.com/repos/dano/compose/branches{/branch}","tags_url":"https://api.github.com/repos/dano/compose/tags","blobs_url":"https://api.github.com/repos/dano/compose/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dano/compose/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dano/compose/git/refs{/sha}","trees_url":"https://api.github.com/repos/dano/compose/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dano/compose/statuses/{sha}","languages_url":"https://api.github.com/repos/dano/compose/languages","stargazers_url":"https://api.github.com/repos/dano/compose/stargazers","contributors_url":"https://api.github.com/repos/dano/compose/contributors","subscribers_url":"https://api.github.com/repos/dano/compose/subscribers","subscription_url":"https://api.github.com/repos/dano/compose/subscription","commits_url":"https://api.github.com/repos/dano/compose/commits{/sha}","git_commits_url":"https://api.github.com/repos/dano/compose/git/commits{/sha}","comments_url":"https://api.github.com/repos/dano/compose/comments{/number}","issue_comment_url":"https://api.github.com/repos/dano/compose/issues/comments{/number}","contents_url":"https://api.github.com/repos/dano/compose/contents/{+path}","compare_url":"https://api.github.com/repos/dano/compose/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dano/compose/merges","archive_url":"https://api.github.com/repos/dano/compose/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dano/compose/downloads","issues_url":"https://api.github.com/repos/dano/compose/issues{/number}","pulls_url":"https://api.github.com/repos/dano/compose/pulls{/number}","milestones_url":"https://api.github.com/repos/dano/compose/milestones{/number}","notifications_url":"https://api.github.com/repos/dano/compose/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dano/compose/labels{/name}","releases_url":"https://api.github.com/repos/dano/compose/releases{/id}","created_at":"2015-06-06T18:40:56Z","updated_at":"2015-06-06T18:40:57Z","pushed_at":"2015-06-06T19:12:17Z","git_url":"git://github.com/dano/compose.git","ssh_url":"git@github.com:dano/compose.git","clone_url":"https://github.com/dano/compose.git","svn_url":"https://github.com/dano/compose","homepage":"https://docs.docker.com/compose/","size":71401,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"docker:master","ref":"master","sha":"417e6ce0c9f67cc719d5f3bfa9e3adbfb16a34eb","user":{"login":"docker","id":5429470,"avatar_url":"https://avatars.githubusercontent.com/u/5429470?v=3","gravatar_id":"","url":"https://api.github.com/users/docker","html_url":"https://github.com/docker","followers_url":"https://api.github.com/users/docker/followers","following_url":"https://api.github.com/users/docker/following{/other_user}","gists_url":"https://api.github.com/users/docker/gists{/gist_id}","starred_url":"https://api.github.com/users/docker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/docker/subscriptions","organizations_url":"https://api.github.com/users/docker/orgs","repos_url":"https://api.github.com/users/docker/repos","events_url":"https://api.github.com/users/docker/events{/privacy}","received_events_url":"https://api.github.com/users/docker/received_events","type":"Organization","site_admin":false},"repo":{"id":15045751,"name":"compose","full_name":"docker/compose","owner":{"login":"docker","id":5429470,"avatar_url":"https://avatars.githubusercontent.com/u/5429470?v=3","gravatar_id":"","url":"https://api.github.com/users/docker","html_url":"https://github.com/docker","followers_url":"https://api.github.com/users/docker/followers","following_url":"https://api.github.com/users/docker/following{/other_user}","gists_url":"https://api.github.com/users/docker/gists{/gist_id}","starred_url":"https://api.github.com/users/docker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/docker/subscriptions","organizations_url":"https://api.github.com/users/docker/orgs","repos_url":"https://api.github.com/users/docker/repos","events_url":"https://api.github.com/users/docker/events{/privacy}","received_events_url":"https://api.github.com/users/docker/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/docker/compose","description":"Define and run multi-container applications with Docker","fork":false,"url":"https://api.github.com/repos/docker/compose","forks_url":"https://api.github.com/repos/docker/compose/forks","keys_url":"https://api.github.com/repos/docker/compose/keys{/key_id}","collaborators_url":"https://api.github.com/repos/docker/compose/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/docker/compose/teams","hooks_url":"https://api.github.com/repos/docker/compose/hooks","issue_events_url":"https://api.github.com/repos/docker/compose/issues/events{/number}","events_url":"https://api.github.com/repos/docker/compose/events","assignees_url":"https://api.github.com/repos/docker/compose/assignees{/user}","branches_url":"https://api.github.com/repos/docker/compose/branches{/branch}","tags_url":"https://api.github.com/repos/docker/compose/tags","blobs_url":"https://api.github.com/repos/docker/compose/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/docker/compose/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/docker/compose/git/refs{/sha}","trees_url":"https://api.github.com/repos/docker/compose/git/trees{/sha}","statuses_url":"https://api.github.com/repos/docker/compose/statuses/{sha}","languages_url":"https://api.github.com/repos/docker/compose/languages","stargazers_url":"https://api.github.com/repos/docker/compose/stargazers","contributors_url":"https://api.github.com/repos/docker/compose/contributors","subscribers_url":"https://api.github.com/repos/docker/compose/subscribers","subscription_url":"https://api.github.com/repos/docker/compose/subscription","commits_url":"https://api.github.com/repos/docker/compose/commits{/sha}","git_commits_url":"https://api.github.com/repos/docker/compose/git/commits{/sha}","comments_url":"https://api.github.com/repos/docker/compose/comments{/number}","issue_comment_url":"https://api.github.com/repos/docker/compose/issues/comments{/number}","contents_url":"https://api.github.com/repos/docker/compose/contents/{+path}","compare_url":"https://api.github.com/repos/docker/compose/compare/{base}...{head}","merges_url":"https://api.github.com/repos/docker/compose/merges","archive_url":"https://api.github.com/repos/docker/compose/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/docker/compose/downloads","issues_url":"https://api.github.com/repos/docker/compose/issues{/number}","pulls_url":"https://api.github.com/repos/docker/compose/pulls{/number}","milestones_url":"https://api.github.com/repos/docker/compose/milestones{/number}","notifications_url":"https://api.github.com/repos/docker/compose/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/docker/compose/labels{/name}","releases_url":"https://api.github.com/repos/docker/compose/releases{/id}","created_at":"2013-12-09T11:40:58Z","updated_at":"2015-06-06T18:16:42Z","pushed_at":"2015-06-05T12:55:25Z","git_url":"git://github.com/docker/compose.git","ssh_url":"git@github.com:docker/compose.git","clone_url":"https://github.com/docker/compose.git","svn_url":"https://github.com/docker/compose","homepage":"https://docs.docker.com/compose/","size":71401,"stargazers_count":5707,"watchers_count":5707,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":635,"mirror_url":null,"open_issues_count":477,"forks":635,"open_issues":477,"watchers":5707,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/docker/compose/pulls/1521"},"html":{"href":"https://github.com/docker/compose/pull/1521"},"issue":{"href":"https://api.github.com/repos/docker/compose/issues/1521"},"comments":{"href":"https://api.github.com/repos/docker/compose/issues/1521/comments"},"review_comments":{"href":"https://api.github.com/repos/docker/compose/pulls/1521/comments"},"review_comment":{"href":"https://api.github.com/repos/docker/compose/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/docker/compose/pulls/1521/commits"},"statuses":{"href":"https://api.github.com/repos/docker/compose/statuses/1dc3a4277332099a97febdeab6b251a881e43d01"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":3,"deletions":0,"changed_files":1}}