{"action":"created","issue":{"url":"https://api.github.com/repos/saltstack/salt/issues/25406","labels_url":"https://api.github.com/repos/saltstack/salt/issues/25406/labels{/name}","comments_url":"https://api.github.com/repos/saltstack/salt/issues/25406/comments","events_url":"https://api.github.com/repos/saltstack/salt/issues/25406/events","html_url":"https://github.com/saltstack/salt/pull/25406","id":94946113,"number":25406,"title":"Force arguments to aptpkg.version_cmp into strings","user":{"login":"anlutro","id":163093,"avatar_url":"https://avatars.githubusercontent.com/u/163093?v=3","gravatar_id":"","url":"https://api.github.com/users/anlutro","html_url":"https://github.com/anlutro","followers_url":"https://api.github.com/users/anlutro/followers","following_url":"https://api.github.com/users/anlutro/following{/other_user}","gists_url":"https://api.github.com/users/anlutro/gists{/gist_id}","starred_url":"https://api.github.com/users/anlutro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anlutro/subscriptions","organizations_url":"https://api.github.com/users/anlutro/orgs","repos_url":"https://api.github.com/users/anlutro/repos","events_url":"https://api.github.com/users/anlutro/events{/privacy}","received_events_url":"https://api.github.com/users/anlutro/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/saltstack/salt/labels/Minor%20Change","name":"Minor Change","color":"bfe5bf"},{"url":"https://api.github.com/repos/saltstack/salt/labels/Platform","name":"Platform","color":"fef2c0"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-14T13:34:07Z","updated_at":"2015-07-14T15:45:34Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/saltstack/salt/pulls/25406","html_url":"https://github.com/saltstack/salt/pull/25406","diff_url":"https://github.com/saltstack/salt/pull/25406.diff","patch_url":"https://github.com/saltstack/salt/pull/25406.patch"},"body":"Followup to https://github.com/saltstack/salt/pull/25369\r\n\r\nVery commonly a float like `2.4` will be passed to the function due to the way module execution and yaml parsing works. This will throw a TypeError in both `apt_pkg.version_compare` and `_cmd_quote`, which will cause the function to simply return `None`.\r\n\r\nFor example, this is 2015.5 after removing the try/except block around the `apt_pkg.version_compare` function call:\r\n\r\n```\r\ntest_state:\r\n  test.fail_without_changes:\r\n    - name: \"{{ salt.pkg.version_cmp('2.5', '2.4') }}\"\r\n\r\n          ID: test_state\r\n    Function: test.fail_without_changes\r\n        Name: {'_error': 'Failed to return clean data', 'stderr': 'Passed invalid arguments: must be string or read-only buffer, not float', 'stdout': ''}\r\n```"},"comment":{"url":"https://api.github.com/repos/saltstack/salt/issues/comments/121286188","html_url":"https://github.com/saltstack/salt/pull/25406#issuecomment-121286188","issue_url":"https://api.github.com/repos/saltstack/salt/issues/25406","id":121286188,"user":{"login":"jtand","id":12056331,"avatar_url":"https://avatars.githubusercontent.com/u/12056331?v=3","gravatar_id":"","url":"https://api.github.com/users/jtand","html_url":"https://github.com/jtand","followers_url":"https://api.github.com/users/jtand/followers","following_url":"https://api.github.com/users/jtand/following{/other_user}","gists_url":"https://api.github.com/users/jtand/gists{/gist_id}","starred_url":"https://api.github.com/users/jtand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jtand/subscriptions","organizations_url":"https://api.github.com/users/jtand/orgs","repos_url":"https://api.github.com/users/jtand/repos","events_url":"https://api.github.com/users/jtand/events{/privacy}","received_events_url":"https://api.github.com/users/jtand/received_events","type":"User","site_admin":false},"created_at":"2015-07-14T15:45:34Z","updated_at":"2015-07-14T15:45:34Z","body":"@anlutro Thanks for the follow up and you're work on this!"}}