{"action":"opened","number":35779,"pull_request":{"url":"https://api.github.com/repos/saltstack/salt/pulls/35779","id":82773757,"html_url":"https://github.com/saltstack/salt/pull/35779","diff_url":"https://github.com/saltstack/salt/pull/35779.diff","patch_url":"https://github.com/saltstack/salt/pull/35779.patch","issue_url":"https://api.github.com/repos/saltstack/salt/issues/35779","number":35779,"state":"open","locked":false,"title":"2015.8 fix pkg latest","user":{"login":"joejulian","id":952828,"avatar_url":"https://avatars.githubusercontent.com/u/952828?v=3","gravatar_id":"","url":"https://api.github.com/users/joejulian","html_url":"https://github.com/joejulian","followers_url":"https://api.github.com/users/joejulian/followers","following_url":"https://api.github.com/users/joejulian/following{/other_user}","gists_url":"https://api.github.com/users/joejulian/gists{/gist_id}","starred_url":"https://api.github.com/users/joejulian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joejulian/subscriptions","organizations_url":"https://api.github.com/users/joejulian/orgs","repos_url":"https://api.github.com/users/joejulian/repos","events_url":"https://api.github.com/users/joejulian/events{/privacy}","received_events_url":"https://api.github.com/users/joejulian/received_events","type":"User","site_admin":false},"body":"### What does this PR do?\r\nI inverted the logic for determining targets to more logically represent the process we're trying to follow. This allows the tests to pass where they both previously failed.\r\n\r\n### What issues does this PR fix or reference?\r\nFixes #35747\r\n\r\n### Previous Behavior\r\nWhen the included tests were run, both tests would fail:\r\n```\r\n --------  Failed Tests  -------------------------------------------------------------------------------\r\n   -> unit.states.pkg_test.PkgTestCase.test_install_multiple_packages_already_installed  ...............\r\n       Traceback (most recent call last):\r\n         File \"/home/jjulian/dev/salt/tests/unit/states/pkg_test.py\", line 57, in test_install_multiple_packages_already_installed\r\n           self.assertDictEqual(pkg.latest(name, pkgs=pkgs), ret)\r\n       AssertionError: {'comment': 'The following packages are set to be installed/upgraded: git, salt- [truncated]... != {'comment': 'All packages are up-to-date (git, salt-zmq, vim).', 'changes': {},  [truncated]...\r\n         {'changes': {},\r\n       -  'comment': 'The following packages are set to be installed/upgraded: git, salt-zmq, vim',\r\n       +  'comment': 'All packages are up-to-date (git, salt-zmq, vim).',\r\n          'name': 'lot',\r\n       -  'result': None}\r\n       ?            ^^^\r\n       \r\n       +  'result': True}\r\n       ?            ^^^\r\n   .....................................................................................................\r\n   -> unit.states.pkg_test.PkgTestCase.test_install_multiple_packages_not_installed  ...................\r\n       Traceback (most recent call last):\r\n         File \"/home/jjulian/dev/salt/tests/unit/states/pkg_test.py\", line 96, in test_install_multiple_packages_not_installed\r\n           self.assertDictEqual(pkg.latest(name, pkgs=pkgs), ret)\r\n       AssertionError: {'comment': 'The following packages are set to be installed/upgraded: git, salt- [truncated]... != {'comment': 'The following packages are set to be installed/upgraded: git, vim T [truncated]...\r\n         {'changes': {},\r\n       -  'comment': 'The following packages are set to be installed/upgraded: git, salt-zmq, vim',\r\n       +  'comment': 'The following packages are set to be installed/upgraded: git, vim The following packages are already up-to-date: salt-zmq (2016.3.2-1)',\r\n          'name': 'lot',\r\n          'result': None}\r\n```\r\n\r\n### New Behavior\r\nTests now pass and the packages are not failing to install when those packages are already the latest version.\r\n\r\n### Tests written?\r\nYes","created_at":"2016-08-25T18:56:58Z","updated_at":"2016-08-25T18:56:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/saltstack/salt/pulls/35779/commits","review_comments_url":"https://api.github.com/repos/saltstack/salt/pulls/35779/comments","review_comment_url":"https://api.github.com/repos/saltstack/salt/pulls/comments{/number}","comments_url":"https://api.github.com/repos/saltstack/salt/issues/35779/comments","statuses_url":"https://api.github.com/repos/saltstack/salt/statuses/aa27939e3e0a760680c07d5455b747a9aeedf2d8","head":{"label":"joejulian:2015.8_fix_pkg_latest","ref":"2015.8_fix_pkg_latest","sha":"aa27939e3e0a760680c07d5455b747a9aeedf2d8","user":{"login":"joejulian","id":952828,"avatar_url":"https://avatars.githubusercontent.com/u/952828?v=3","gravatar_id":"","url":"https://api.github.com/users/joejulian","html_url":"https://github.com/joejulian","followers_url":"https://api.github.com/users/joejulian/followers","following_url":"https://api.github.com/users/joejulian/following{/other_user}","gists_url":"https://api.github.com/users/joejulian/gists{/gist_id}","starred_url":"https://api.github.com/users/joejulian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joejulian/subscriptions","organizations_url":"https://api.github.com/users/joejulian/orgs","repos_url":"https://api.github.com/users/joejulian/repos","events_url":"https://api.github.com/users/joejulian/events{/privacy}","received_events_url":"https://api.github.com/users/joejulian/received_events","type":"User","site_admin":false},"repo":{"id":25240416,"name":"salt","full_name":"joejulian/salt","owner":{"login":"joejulian","id":952828,"avatar_url":"https://avatars.githubusercontent.com/u/952828?v=3","gravatar_id":"","url":"https://api.github.com/users/joejulian","html_url":"https://github.com/joejulian","followers_url":"https://api.github.com/users/joejulian/followers","following_url":"https://api.github.com/users/joejulian/following{/other_user}","gists_url":"https://api.github.com/users/joejulian/gists{/gist_id}","starred_url":"https://api.github.com/users/joejulian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joejulian/subscriptions","organizations_url":"https://api.github.com/users/joejulian/orgs","repos_url":"https://api.github.com/users/joejulian/repos","events_url":"https://api.github.com/users/joejulian/events{/privacy}","received_events_url":"https://api.github.com/users/joejulian/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/joejulian/salt","description":"Infrastructure automation and management system","fork":true,"url":"https://api.github.com/repos/joejulian/salt","forks_url":"https://api.github.com/repos/joejulian/salt/forks","keys_url":"https://api.github.com/repos/joejulian/salt/keys{/key_id}","collaborators_url":"https://api.github.com/repos/joejulian/salt/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/joejulian/salt/teams","hooks_url":"https://api.github.com/repos/joejulian/salt/hooks","issue_events_url":"https://api.github.com/repos/joejulian/salt/issues/events{/number}","events_url":"https://api.github.com/repos/joejulian/salt/events","assignees_url":"https://api.github.com/repos/joejulian/salt/assignees{/user}","branches_url":"https://api.github.com/repos/joejulian/salt/branches{/branch}","tags_url":"https://api.github.com/repos/joejulian/salt/tags","blobs_url":"https://api.github.com/repos/joejulian/salt/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/joejulian/salt/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/joejulian/salt/git/refs{/sha}","trees_url":"https://api.github.com/repos/joejulian/salt/git/trees{/sha}","statuses_url":"https://api.github.com/repos/joejulian/salt/statuses/{sha}","languages_url":"https://api.github.com/repos/joejulian/salt/languages","stargazers_url":"https://api.github.com/repos/joejulian/salt/stargazers","contributors_url":"https://api.github.com/repos/joejulian/salt/contributors","subscribers_url":"https://api.github.com/repos/joejulian/salt/subscribers","subscription_url":"https://api.github.com/repos/joejulian/salt/subscription","commits_url":"https://api.github.com/repos/joejulian/salt/commits{/sha}","git_commits_url":"https://api.github.com/repos/joejulian/salt/git/commits{/sha}","comments_url":"https://api.github.com/repos/joejulian/salt/comments{/number}","issue_comment_url":"https://api.github.com/repos/joejulian/salt/issues/comments{/number}","contents_url":"https://api.github.com/repos/joejulian/salt/contents/{+path}","compare_url":"https://api.github.com/repos/joejulian/salt/compare/{base}...{head}","merges_url":"https://api.github.com/repos/joejulian/salt/merges","archive_url":"https://api.github.com/repos/joejulian/salt/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/joejulian/salt/downloads","issues_url":"https://api.github.com/repos/joejulian/salt/issues{/number}","pulls_url":"https://api.github.com/repos/joejulian/salt/pulls{/number}","milestones_url":"https://api.github.com/repos/joejulian/salt/milestones{/number}","notifications_url":"https://api.github.com/repos/joejulian/salt/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/joejulian/salt/labels{/name}","releases_url":"https://api.github.com/repos/joejulian/salt/releases{/id}","deployments_url":"https://api.github.com/repos/joejulian/salt/deployments","created_at":"2014-10-15T05:39:22Z","updated_at":"2016-03-01T19:03:46Z","pushed_at":"2016-08-25T18:53:02Z","git_url":"git://github.com/joejulian/salt.git","ssh_url":"git@github.com:joejulian/salt.git","clone_url":"https://github.com/joejulian/salt.git","svn_url":"https://github.com/joejulian/salt","homepage":"saltstack.com","size":139016,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"saltstack:2015.8","ref":"2015.8","sha":"2a12795baca77937801697281ba4cb8cb902adeb","user":{"login":"saltstack","id":1147473,"avatar_url":"https://avatars.githubusercontent.com/u/1147473?v=3","gravatar_id":"","url":"https://api.github.com/users/saltstack","html_url":"https://github.com/saltstack","followers_url":"https://api.github.com/users/saltstack/followers","following_url":"https://api.github.com/users/saltstack/following{/other_user}","gists_url":"https://api.github.com/users/saltstack/gists{/gist_id}","starred_url":"https://api.github.com/users/saltstack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/saltstack/subscriptions","organizations_url":"https://api.github.com/users/saltstack/orgs","repos_url":"https://api.github.com/users/saltstack/repos","events_url":"https://api.github.com/users/saltstack/events{/privacy}","received_events_url":"https://api.github.com/users/saltstack/received_events","type":"Organization","site_admin":false},"repo":{"id":1390248,"name":"salt","full_name":"saltstack/salt","owner":{"login":"saltstack","id":1147473,"avatar_url":"https://avatars.githubusercontent.com/u/1147473?v=3","gravatar_id":"","url":"https://api.github.com/users/saltstack","html_url":"https://github.com/saltstack","followers_url":"https://api.github.com/users/saltstack/followers","following_url":"https://api.github.com/users/saltstack/following{/other_user}","gists_url":"https://api.github.com/users/saltstack/gists{/gist_id}","starred_url":"https://api.github.com/users/saltstack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/saltstack/subscriptions","organizations_url":"https://api.github.com/users/saltstack/orgs","repos_url":"https://api.github.com/users/saltstack/repos","events_url":"https://api.github.com/users/saltstack/events{/privacy}","received_events_url":"https://api.github.com/users/saltstack/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/saltstack/salt","description":"Software to automate the management and configuration of any infrastructure or application at scale. Get access to the Salt Open software package repository here: ","fork":false,"url":"https://api.github.com/repos/saltstack/salt","forks_url":"https://api.github.com/repos/saltstack/salt/forks","keys_url":"https://api.github.com/repos/saltstack/salt/keys{/key_id}","collaborators_url":"https://api.github.com/repos/saltstack/salt/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/saltstack/salt/teams","hooks_url":"https://api.github.com/repos/saltstack/salt/hooks","issue_events_url":"https://api.github.com/repos/saltstack/salt/issues/events{/number}","events_url":"https://api.github.com/repos/saltstack/salt/events","assignees_url":"https://api.github.com/repos/saltstack/salt/assignees{/user}","branches_url":"https://api.github.com/repos/saltstack/salt/branches{/branch}","tags_url":"https://api.github.com/repos/saltstack/salt/tags","blobs_url":"https://api.github.com/repos/saltstack/salt/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/saltstack/salt/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/saltstack/salt/git/refs{/sha}","trees_url":"https://api.github.com/repos/saltstack/salt/git/trees{/sha}","statuses_url":"https://api.github.com/repos/saltstack/salt/statuses/{sha}","languages_url":"https://api.github.com/repos/saltstack/salt/languages","stargazers_url":"https://api.github.com/repos/saltstack/salt/stargazers","contributors_url":"https://api.github.com/repos/saltstack/salt/contributors","subscribers_url":"https://api.github.com/repos/saltstack/salt/subscribers","subscription_url":"https://api.github.com/repos/saltstack/salt/subscription","commits_url":"https://api.github.com/repos/saltstack/salt/commits{/sha}","git_commits_url":"https://api.github.com/repos/saltstack/salt/git/commits{/sha}","comments_url":"https://api.github.com/repos/saltstack/salt/comments{/number}","issue_comment_url":"https://api.github.com/repos/saltstack/salt/issues/comments{/number}","contents_url":"https://api.github.com/repos/saltstack/salt/contents/{+path}","compare_url":"https://api.github.com/repos/saltstack/salt/compare/{base}...{head}","merges_url":"https://api.github.com/repos/saltstack/salt/merges","archive_url":"https://api.github.com/repos/saltstack/salt/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/saltstack/salt/downloads","issues_url":"https://api.github.com/repos/saltstack/salt/issues{/number}","pulls_url":"https://api.github.com/repos/saltstack/salt/pulls{/number}","milestones_url":"https://api.github.com/repos/saltstack/salt/milestones{/number}","notifications_url":"https://api.github.com/repos/saltstack/salt/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/saltstack/salt/labels{/name}","releases_url":"https://api.github.com/repos/saltstack/salt/releases{/id}","deployments_url":"https://api.github.com/repos/saltstack/salt/deployments","created_at":"2011-02-20T20:16:56Z","updated_at":"2016-08-25T11:09:46Z","pushed_at":"2016-08-25T18:56:58Z","git_url":"git://github.com/saltstack/salt.git","ssh_url":"git@github.com:saltstack/salt.git","clone_url":"https://github.com/saltstack/salt.git","svn_url":"https://github.com/saltstack/salt","homepage":"https://repo.saltstack.com/","size":213934,"stargazers_count":6815,"watchers_count":6815,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3090,"mirror_url":null,"open_issues_count":3826,"forks":3090,"open_issues":3826,"watchers":6815,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/saltstack/salt/pulls/35779"},"html":{"href":"https://github.com/saltstack/salt/pull/35779"},"issue":{"href":"https://api.github.com/repos/saltstack/salt/issues/35779"},"comments":{"href":"https://api.github.com/repos/saltstack/salt/issues/35779/comments"},"review_comments":{"href":"https://api.github.com/repos/saltstack/salt/pulls/35779/comments"},"review_comment":{"href":"https://api.github.com/repos/saltstack/salt/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/saltstack/salt/pulls/35779/commits"},"statuses":{"href":"https://api.github.com/repos/saltstack/salt/statuses/aa27939e3e0a760680c07d5455b747a9aeedf2d8"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":2,"additions":474,"deletions":947,"changed_files":2}}
{"actor":{"display_login":"joejulian"}}