{"action":"created","comment":{"url":"https://api.github.com/repos/mesosphere/dcos-cli/pulls/comments/32856191","id":32856191,"diff_hunk":"@@ -256,16 +319,62 @@ def _framework_dicts(self, inactive=False, completed=False):\n class Slave(object):\n     \"\"\"Mesos Slave Model\n \n-    :param slave: dictionary representing the slave.\n-                  retrieved from master/state.json\n-    :type slave: dict\n+    :param short_state: slave's entry from the master's state.json\n+    :type short_state: dict\n+    :param state: slave's state.json\n+    :type state: dict\n+    :param master: slave's master\n+    :type master: Master\n     \"\"\"\n \n-    def __init__(self, slave):\n-        self._slave = slave\n+    def __init__(self, short_state, state, master):\n+        self._short_state = short_state\n+        self._state = state\n+        self._master = master\n+\n+    def state(self):\n+        \"\"\"Get the slave's state.json object.  Fetch it if it's not already\n+        an instance variable.\n+\n+        :returns: This slave's state.json object\n+        :rtype: dict\n+        \"\"\"\n+\n+        if not self._state:\n+            self._state = MesosClient().get_slave_state(self['id'])\n+        return self._state\n+\n+    def _framework_dicts(self):\n+        \"\"\"Returns the framework dictionaries from the state.json dict\n+\n+        :returns: frameworks\n+        :rtype: [dict]\n+        \"\"\"\n+\n+        return _merge(self._state, ['frameworks', 'completed_frameworks'])\n+\n+    def executor_dicts(self):\n+        \"\"\"Returns the executor dictionaries from the state.json\n+\n+        :returns: executors\n+        :rtype: [dict]\n+        \"\"\"\n+\n+        iters = [_merge(framework, ['executors', 'completed_executors'])\n+                 for framework in self._framework_dicts()]\n+        return itertools.chain(*iters)\n \n     def __getitem__(self, name):\n-        return self._slave[name]\n+        \"\"\"Support the slave[attr] syntax\n+\n+        :param name: attribute to get\n+        :type name: str\n+        :returns: the value for this attribute in the underlying\n+                  slave dictionary\n+        :rtype: object\n+        \"\"\"\n+\n+        return self._short_state[name]","path":"dcos/mesos.py","position":428,"original_position":428,"commit_id":"a356b1bd0f9a4b14ce0fceb31418db00c26d64ca","original_commit_id":"f570e17c7c3faae91cee12b7a52c7f423adc5983","user":{"login":"mgummelt","id":153734,"avatar_url":"https://avatars.githubusercontent.com/u/153734?v=3","gravatar_id":"","url":"https://api.github.com/users/mgummelt","html_url":"https://github.com/mgummelt","followers_url":"https://api.github.com/users/mgummelt/followers","following_url":"https://api.github.com/users/mgummelt/following{/other_user}","gists_url":"https://api.github.com/users/mgummelt/gists{/gist_id}","starred_url":"https://api.github.com/users/mgummelt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mgummelt/subscriptions","organizations_url":"https://api.github.com/users/mgummelt/orgs","repos_url":"https://api.github.com/users/mgummelt/repos","events_url":"https://api.github.com/users/mgummelt/events{/privacy}","received_events_url":"https://api.github.com/users/mgummelt/received_events","type":"User","site_admin":false},"body":"__getitem__ is supposed to raise a KeyError upon missing key","created_at":"2015-06-19T18:30:18Z","updated_at":"2015-06-19T18:30:18Z","html_url":"https://github.com/mesosphere/dcos-cli/pull/181#discussion_r32856191","pull_request_url":"https://api.github.com/repos/mesosphere/dcos-cli/pulls/181","_links":{"self":{"href":"https://api.github.com/repos/mesosphere/dcos-cli/pulls/comments/32856191"},"html":{"href":"https://github.com/mesosphere/dcos-cli/pull/181#discussion_r32856191"},"pull_request":{"href":"https://api.github.com/repos/mesosphere/dcos-cli/pulls/181"}}},"pull_request":{"url":"https://api.github.com/repos/mesosphere/dcos-cli/pulls/181","id":35994159,"html_url":"https://github.com/mesosphere/dcos-cli/pull/181","diff_url":"https://github.com/mesosphere/dcos-cli/pull/181.diff","patch_url":"https://github.com/mesosphere/dcos-cli/pull/181.patch","issue_url":"https://api.github.com/repos/mesosphere/dcos-cli/issues/181","number":181,"state":"open","locked":false,"title":"dcos tail -- DCOS-1133","user":{"login":"mgummelt","id":153734,"avatar_url":"https://avatars.githubusercontent.com/u/153734?v=3","gravatar_id":"","url":"https://api.github.com/users/mgummelt","html_url":"https://github.com/mgummelt","followers_url":"https://api.github.com/users/mgummelt/followers","following_url":"https://api.github.com/users/mgummelt/following{/other_user}","gists_url":"https://api.github.com/users/mgummelt/gists{/gist_id}","starred_url":"https://api.github.com/users/mgummelt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mgummelt/subscriptions","organizations_url":"https://api.github.com/users/mgummelt/orgs","repos_url":"https://api.github.com/users/mgummelt/repos","events_url":"https://api.github.com/users/mgummelt/events{/privacy}","received_events_url":"https://api.github.com/users/mgummelt/received_events","type":"User","site_admin":false},"body":"This is missing tests.  I figured I'd go ahead and get the conversation started while I write the tests, then we can review tests separately later (part of the same PR, of course).  \r\n\r\nTomorrow (5/22), I'll mark this up with comments describing some of my design decisions.","created_at":"2015-05-22T01:48:14Z","updated_at":"2015-06-19T18:30:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0a9ba262959dda60b108846f064c53d8b69ab366","assignee":{"login":"tamarrow","id":1292768,"avatar_url":"https://avatars.githubusercontent.com/u/1292768?v=3","gravatar_id":"","url":"https://api.github.com/users/tamarrow","html_url":"https://github.com/tamarrow","followers_url":"https://api.github.com/users/tamarrow/followers","following_url":"https://api.github.com/users/tamarrow/following{/other_user}","gists_url":"https://api.github.com/users/tamarrow/gists{/gist_id}","starred_url":"https://api.github.com/users/tamarrow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tamarrow/subscriptions","organizations_url":"https://api.github.com/users/tamarrow/orgs","repos_url":"https://api.github.com/users/tamarrow/repos","events_url":"https://api.github.com/users/tamarrow/events{/privacy}","received_events_url":"https://api.github.com/users/tamarrow/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/mesosphere/dcos-cli/pulls/181/commits","review_comments_url":"https://api.github.com/repos/mesosphere/dcos-cli/pulls/181/comments","review_comment_url":"https://api.github.com/repos/mesosphere/dcos-cli/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mesosphere/dcos-cli/issues/181/comments","statuses_url":"https://api.github.com/repos/mesosphere/dcos-cli/statuses/a356b1bd0f9a4b14ce0fceb31418db00c26d64ca","head":{"label":"mesosphere:dcos-1133-tail","ref":"dcos-1133-tail","sha":"a356b1bd0f9a4b14ce0fceb31418db00c26d64ca","user":{"login":"mesosphere","id":3458585,"avatar_url":"https://avatars.githubusercontent.com/u/3458585?v=3","gravatar_id":"","url":"https://api.github.com/users/mesosphere","html_url":"https://github.com/mesosphere","followers_url":"https://api.github.com/users/mesosphere/followers","following_url":"https://api.github.com/users/mesosphere/following{/other_user}","gists_url":"https://api.github.com/users/mesosphere/gists{/gist_id}","starred_url":"https://api.github.com/users/mesosphere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mesosphere/subscriptions","organizations_url":"https://api.github.com/users/mesosphere/orgs","repos_url":"https://api.github.com/users/mesosphere/repos","events_url":"https://api.github.com/users/mesosphere/events{/privacy}","received_events_url":"https://api.github.com/users/mesosphere/received_events","type":"Organization","site_admin":false},"repo":{"id":26653348,"name":"dcos-cli","full_name":"mesosphere/dcos-cli","owner":{"login":"mesosphere","id":3458585,"avatar_url":"https://avatars.githubusercontent.com/u/3458585?v=3","gravatar_id":"","url":"https://api.github.com/users/mesosphere","html_url":"https://github.com/mesosphere","followers_url":"https://api.github.com/users/mesosphere/followers","following_url":"https://api.github.com/users/mesosphere/following{/other_user}","gists_url":"https://api.github.com/users/mesosphere/gists{/gist_id}","starred_url":"https://api.github.com/users/mesosphere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mesosphere/subscriptions","organizations_url":"https://api.github.com/users/mesosphere/orgs","repos_url":"https://api.github.com/users/mesosphere/repos","events_url":"https://api.github.com/users/mesosphere/events{/privacy}","received_events_url":"https://api.github.com/users/mesosphere/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mesosphere/dcos-cli","description":"The command line for your datacenter! ","fork":false,"url":"https://api.github.com/repos/mesosphere/dcos-cli","forks_url":"https://api.github.com/repos/mesosphere/dcos-cli/forks","keys_url":"https://api.github.com/repos/mesosphere/dcos-cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mesosphere/dcos-cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mesosphere/dcos-cli/teams","hooks_url":"https://api.github.com/repos/mesosphere/dcos-cli/hooks","issue_events_url":"https://api.github.com/repos/mesosphere/dcos-cli/issues/events{/number}","events_url":"https://api.github.com/repos/mesosphere/dcos-cli/events","assignees_url":"https://api.github.com/repos/mesosphere/dcos-cli/assignees{/user}","branches_url":"https://api.github.com/repos/mesosphere/dcos-cli/branches{/branch}","tags_url":"https://api.github.com/repos/mesosphere/dcos-cli/tags","blobs_url":"https://api.github.com/repos/mesosphere/dcos-cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mesosphere/dcos-cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mesosphere/dcos-cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/mesosphere/dcos-cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mesosphere/dcos-cli/statuses/{sha}","languages_url":"https://api.github.com/repos/mesosphere/dcos-cli/languages","stargazers_url":"https://api.github.com/repos/mesosphere/dcos-cli/stargazers","contributors_url":"https://api.github.com/repos/mesosphere/dcos-cli/contributors","subscribers_url":"https://api.github.com/repos/mesosphere/dcos-cli/subscribers","subscription_url":"https://api.github.com/repos/mesosphere/dcos-cli/subscription","commits_url":"https://api.github.com/repos/mesosphere/dcos-cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/mesosphere/dcos-cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/mesosphere/dcos-cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/mesosphere/dcos-cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/mesosphere/dcos-cli/contents/{+path}","compare_url":"https://api.github.com/repos/mesosphere/dcos-cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mesosphere/dcos-cli/merges","archive_url":"https://api.github.com/repos/mesosphere/dcos-cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mesosphere/dcos-cli/downloads","issues_url":"https://api.github.com/repos/mesosphere/dcos-cli/issues{/number}","pulls_url":"https://api.github.com/repos/mesosphere/dcos-cli/pulls{/number}","milestones_url":"https://api.github.com/repos/mesosphere/dcos-cli/milestones{/number}","notifications_url":"https://api.github.com/repos/mesosphere/dcos-cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mesosphere/dcos-cli/labels{/name}","releases_url":"https://api.github.com/repos/mesosphere/dcos-cli/releases{/id}","created_at":"2014-11-14T19:11:48Z","updated_at":"2015-06-19T15:22:00Z","pushed_at":"2015-06-19T18:27:03Z","git_url":"git://github.com/mesosphere/dcos-cli.git","ssh_url":"git@github.com:mesosphere/dcos-cli.git","clone_url":"https://github.com/mesosphere/dcos-cli.git","svn_url":"https://github.com/mesosphere/dcos-cli","homepage":"http://docs.mesosphere.com/using/cli/","size":6103,"stargazers_count":19,"watchers_count":19,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":11,"forks":2,"open_issues":11,"watchers":19,"default_branch":"master"}},"base":{"label":"mesosphere:master","ref":"master","sha":"c8478d89b8026781e82e293dc84dfa1c18c3c047","user":{"login":"mesosphere","id":3458585,"avatar_url":"https://avatars.githubusercontent.com/u/3458585?v=3","gravatar_id":"","url":"https://api.github.com/users/mesosphere","html_url":"https://github.com/mesosphere","followers_url":"https://api.github.com/users/mesosphere/followers","following_url":"https://api.github.com/users/mesosphere/following{/other_user}","gists_url":"https://api.github.com/users/mesosphere/gists{/gist_id}","starred_url":"https://api.github.com/users/mesosphere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mesosphere/subscriptions","organizations_url":"https://api.github.com/users/mesosphere/orgs","repos_url":"https://api.github.com/users/mesosphere/repos","events_url":"https://api.github.com/users/mesosphere/events{/privacy}","received_events_url":"https://api.github.com/users/mesosphere/received_events","type":"Organization","site_admin":false},"repo":{"id":26653348,"name":"dcos-cli","full_name":"mesosphere/dcos-cli","owner":{"login":"mesosphere","id":3458585,"avatar_url":"https://avatars.githubusercontent.com/u/3458585?v=3","gravatar_id":"","url":"https://api.github.com/users/mesosphere","html_url":"https://github.com/mesosphere","followers_url":"https://api.github.com/users/mesosphere/followers","following_url":"https://api.github.com/users/mesosphere/following{/other_user}","gists_url":"https://api.github.com/users/mesosphere/gists{/gist_id}","starred_url":"https://api.github.com/users/mesosphere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mesosphere/subscriptions","organizations_url":"https://api.github.com/users/mesosphere/orgs","repos_url":"https://api.github.com/users/mesosphere/repos","events_url":"https://api.github.com/users/mesosphere/events{/privacy}","received_events_url":"https://api.github.com/users/mesosphere/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mesosphere/dcos-cli","description":"The command line for your datacenter! ","fork":false,"url":"https://api.github.com/repos/mesosphere/dcos-cli","forks_url":"https://api.github.com/repos/mesosphere/dcos-cli/forks","keys_url":"https://api.github.com/repos/mesosphere/dcos-cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mesosphere/dcos-cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mesosphere/dcos-cli/teams","hooks_url":"https://api.github.com/repos/mesosphere/dcos-cli/hooks","issue_events_url":"https://api.github.com/repos/mesosphere/dcos-cli/issues/events{/number}","events_url":"https://api.github.com/repos/mesosphere/dcos-cli/events","assignees_url":"https://api.github.com/repos/mesosphere/dcos-cli/assignees{/user}","branches_url":"https://api.github.com/repos/mesosphere/dcos-cli/branches{/branch}","tags_url":"https://api.github.com/repos/mesosphere/dcos-cli/tags","blobs_url":"https://api.github.com/repos/mesosphere/dcos-cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mesosphere/dcos-cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mesosphere/dcos-cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/mesosphere/dcos-cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mesosphere/dcos-cli/statuses/{sha}","languages_url":"https://api.github.com/repos/mesosphere/dcos-cli/languages","stargazers_url":"https://api.github.com/repos/mesosphere/dcos-cli/stargazers","contributors_url":"https://api.github.com/repos/mesosphere/dcos-cli/contributors","subscribers_url":"https://api.github.com/repos/mesosphere/dcos-cli/subscribers","subscription_url":"https://api.github.com/repos/mesosphere/dcos-cli/subscription","commits_url":"https://api.github.com/repos/mesosphere/dcos-cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/mesosphere/dcos-cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/mesosphere/dcos-cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/mesosphere/dcos-cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/mesosphere/dcos-cli/contents/{+path}","compare_url":"https://api.github.com/repos/mesosphere/dcos-cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mesosphere/dcos-cli/merges","archive_url":"https://api.github.com/repos/mesosphere/dcos-cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mesosphere/dcos-cli/downloads","issues_url":"https://api.github.com/repos/mesosphere/dcos-cli/issues{/number}","pulls_url":"https://api.github.com/repos/mesosphere/dcos-cli/pulls{/number}","milestones_url":"https://api.github.com/repos/mesosphere/dcos-cli/milestones{/number}","notifications_url":"https://api.github.com/repos/mesosphere/dcos-cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mesosphere/dcos-cli/labels{/name}","releases_url":"https://api.github.com/repos/mesosphere/dcos-cli/releases{/id}","created_at":"2014-11-14T19:11:48Z","updated_at":"2015-06-19T15:22:00Z","pushed_at":"2015-06-19T18:27:03Z","git_url":"git://github.com/mesosphere/dcos-cli.git","ssh_url":"git@github.com:mesosphere/dcos-cli.git","clone_url":"https://github.com/mesosphere/dcos-cli.git","svn_url":"https://github.com/mesosphere/dcos-cli","homepage":"http://docs.mesosphere.com/using/cli/","size":6103,"stargazers_count":19,"watchers_count":19,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":11,"forks":2,"open_issues":11,"watchers":19,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mesosphere/dcos-cli/pulls/181"},"html":{"href":"https://github.com/mesosphere/dcos-cli/pull/181"},"issue":{"href":"https://api.github.com/repos/mesosphere/dcos-cli/issues/181"},"comments":{"href":"https://api.github.com/repos/mesosphere/dcos-cli/issues/181/comments"},"review_comments":{"href":"https://api.github.com/repos/mesosphere/dcos-cli/pulls/181/comments"},"review_comment":{"href":"https://api.github.com/repos/mesosphere/dcos-cli/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mesosphere/dcos-cli/pulls/181/commits"},"statuses":{"href":"https://api.github.com/repos/mesosphere/dcos-cli/statuses/a356b1bd0f9a4b14ce0fceb31418db00c26d64ca"}}}}