{"action":"created","issue":{"url":"https://api.github.com/repos/saltstack/salt/issues/31394","repository_url":"https://api.github.com/repos/saltstack/salt","labels_url":"https://api.github.com/repos/saltstack/salt/issues/31394/labels{/name}","comments_url":"https://api.github.com/repos/saltstack/salt/issues/31394/comments","events_url":"https://api.github.com/repos/saltstack/salt/issues/31394/events","html_url":"https://github.com/saltstack/salt/issues/31394","id":135246983,"number":31394,"title":"file.serialize bug: TypeError: manage_file() got an unexpected keyword argument 'show_diff'","user":{"login":"aboe76","id":1800660,"avatar_url":"https://avatars.githubusercontent.com/u/1800660?v=3","gravatar_id":"","url":"https://api.github.com/users/aboe76","html_url":"https://github.com/aboe76","followers_url":"https://api.github.com/users/aboe76/followers","following_url":"https://api.github.com/users/aboe76/following{/other_user}","gists_url":"https://api.github.com/users/aboe76/gists{/gist_id}","starred_url":"https://api.github.com/users/aboe76/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aboe76/subscriptions","organizations_url":"https://api.github.com/users/aboe76/orgs","repos_url":"https://api.github.com/users/aboe76/repos","events_url":"https://api.github.com/users/aboe76/events{/privacy}","received_events_url":"https://api.github.com/users/aboe76/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-02-21T19:23:52Z","updated_at":"2016-02-21T19:34:18Z","closed_at":null,"body":"I think I found a bug in the file.serialize state:\r\n\r\n```\r\n/tmp/test:\r\n  file.serialize:\r\n    - dataset_pillar: salt:minion\r\n    - formatter: yaml\r\n```\r\n\r\nproduces the following error:\r\n```\r\n[INFO    ] Determining pillar cache\r\n[INFO    ] Determining pillar cache\r\n[INFO    ] Loading fresh modules for state activity\r\n[INFO    ] Fetching file from saltenv 'base', ** done ** 'test/init.sls'\r\n[INFO    ] Running state [/tmp/test] at time 20:18:44.922258\r\n[INFO    ] Executing state file.serialize for /tmp/test\r\n[ERROR   ] An exception occurred in this state: Traceback (most recent call last):\r\n  File \"/usr/lib/python2.7/site-packages/salt/state.py\", line 1701, in call\r\n    **cdata['kwargs'])\r\n  File \"/usr/lib/python2.7/site-packages/salt/loader.py\", line 1619, in wrapper\r\n    return f(*args, **kwargs)\r\n  File \"/usr/lib/python2.7/site-packages/salt/states/file.py\", line 4613, in serialize\r\n    contents=contents)\r\nTypeError: manage_file() got an unexpected keyword argument 'show_diff'\r\n\r\n[INFO    ] Completed state [/tmp/test] at time 20:18:45.028819 duration_in_ms=106.561\r\nlocal:\r\n----------\r\n          ID: /tmp/test\r\n    Function: file.serialize\r\n      Result: False\r\n     Comment: An exception occurred in this state: Traceback (most recent call last):\r\n                File \"/usr/lib/python2.7/site-packages/salt/state.py\", line 1701, in call\r\n                  **cdata['kwargs'])\r\n                File \"/usr/lib/python2.7/site-packages/salt/loader.py\", line 1619, in wrapper\r\n                  return f(*args, **kwargs)\r\n                File \"/usr/lib/python2.7/site-packages/salt/states/file.py\", line 4613, in serialize\r\n                  contents=contents)\r\n              TypeError: manage_file() got an unexpected keyword argument 'show_diff'\r\n     Started: 20:18:44.922258\r\n    Duration: 106.561 ms\r\n     Changes:   \r\n\r\nSummary for local\r\n------------\r\nSucceeded: 0\r\nFailed:    1\r\n------------\r\nTotal states run:     1\r\n```\r\n\r\nSalt environment:\r\n```\r\nsalt-call test.versions_report \r\n[INFO    ] Determining pillar cache\r\nlocal:\r\n    Salt Version:\r\n               Salt: 2016.3.0-109-gcb2f252\r\n     \r\n    Dependency Versions:\r\n             Jinja2: 2.8\r\n           M2Crypto: 0.21.1\r\n               Mako: 1.0.3\r\n             PyYAML: 3.11\r\n              PyZMQ: 15.2.0\r\n             Python: 2.7.11 (default, Dec  6 2015, 15:43:46)\r\n               RAET: 0.6.5\r\n            Tornado: 4.3\r\n                ZMQ: 4.1.3\r\n               cffi: 1.5.2\r\n           cherrypy: 4.0.0\r\n           dateutil: 2.4.2\r\n              gitdb: 0.6.4\r\n          gitpython: 1.0.1\r\n              ioflo: 1.5.0\r\n            libgit2: 0.23.4\r\n            libnacl: 1.4.4\r\n       msgpack-pure: Not Installed\r\n     msgpack-python: 0.4.7\r\n       mysql-python: Not Installed\r\n          pycparser: 2.14\r\n           pycrypto: 2.6.1\r\n             pygit2: 0.23.3\r\n       python-gnupg: 0.3.7\r\n              smmap: 0.9.0\r\n            timelib: 0.2.4\r\n     \r\n    System Versions:\r\n               dist:   \r\n            machine: x86_64\r\n            release: 4.4.1-2-ARCH\r\n```"},"comment":{"url":"https://api.github.com/repos/saltstack/salt/issues/comments/186895613","html_url":"https://github.com/saltstack/salt/issues/31394#issuecomment-186895613","issue_url":"https://api.github.com/repos/saltstack/salt/issues/31394","id":186895613,"user":{"login":"aboe76","id":1800660,"avatar_url":"https://avatars.githubusercontent.com/u/1800660?v=3","gravatar_id":"","url":"https://api.github.com/users/aboe76","html_url":"https://github.com/aboe76","followers_url":"https://api.github.com/users/aboe76/followers","following_url":"https://api.github.com/users/aboe76/following{/other_user}","gists_url":"https://api.github.com/users/aboe76/gists{/gist_id}","starred_url":"https://api.github.com/users/aboe76/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aboe76/subscriptions","organizations_url":"https://api.github.com/users/aboe76/orgs","repos_url":"https://api.github.com/users/aboe76/repos","events_url":"https://api.github.com/users/aboe76/events{/privacy}","received_events_url":"https://api.github.com/users/aboe76/received_events","type":"User","site_admin":false},"created_at":"2016-02-21T19:34:18Z","updated_at":"2016-02-21T19:34:18Z","body":"Fix should be easy I think:\r\n\r\nremove line 4612 in salt/states/file.py:\r\n```\r\nshow_diff=show_diff,\r\n```\r\n\r\nfrom the return code:\r\n```\r\nreturn __salt__['file.manage_file'](name=name,\r\n                                        sfn='',\r\n                                        ret=ret,\r\n                                        source=None,\r\n                                        source_sum={},\r\n                                        user=user,\r\n                                        group=group,\r\n                                        mode=mode,\r\n                                        saltenv=__env__,\r\n                                        backup=backup,\r\n                                        makedirs=makedirs,\r\n                                        template=None,\r\n                                        show_diff=show_diff,\r\n                                        contents=contents)\r\n```"}}