{"action":"closed","issue":{"url":"https://api.github.com/repos/saltstack/salt/issues/47713","repository_url":"https://api.github.com/repos/saltstack/salt","labels_url":"https://api.github.com/repos/saltstack/salt/issues/47713/labels{/name}","comments_url":"https://api.github.com/repos/saltstack/salt/issues/47713/comments","events_url":"https://api.github.com/repos/saltstack/salt/issues/47713/events","html_url":"https://github.com/saltstack/salt/issues/47713","id":324219338,"node_id":"MDU6SXNzdWUzMjQyMTkzMzg=","number":47713,"title":"Error while setting adaptive_rx with state.ethtool","user":{"login":"slaws","id":5597551,"node_id":"MDQ6VXNlcjU1OTc1NTE=","avatar_url":"https://avatars3.githubusercontent.com/u/5597551?v=4","gravatar_id":"","url":"https://api.github.com/users/slaws","html_url":"https://github.com/slaws","followers_url":"https://api.github.com/users/slaws/followers","following_url":"https://api.github.com/users/slaws/following{/other_user}","gists_url":"https://api.github.com/users/slaws/gists{/gist_id}","starred_url":"https://api.github.com/users/slaws/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slaws/subscriptions","organizations_url":"https://api.github.com/users/slaws/orgs","repos_url":"https://api.github.com/users/slaws/repos","events_url":"https://api.github.com/users/slaws/events{/privacy}","received_events_url":"https://api.github.com/users/slaws/received_events","type":"User","site_admin":false},"labels":[{"id":77737132,"node_id":"MDU6TGFiZWw3NzczNzEzMg==","url":"https://api.github.com/repos/saltstack/salt/labels/Pending%20Discussion","name":"Pending Discussion","color":"c7def8","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/saltstack/salt/milestones/37","html_url":"https://github.com/saltstack/salt/milestone/37","labels_url":"https://api.github.com/repos/saltstack/salt/milestones/37/labels","id":343741,"node_id":"MDk6TWlsZXN0b25lMzQzNzQx","number":37,"title":"Blocked","description":"Issues which are blocked in some way, whether they need further discussion, clarification, justification, or are blocked for some other reason.","creator":{"login":"basepi","id":702318,"node_id":"MDQ6VXNlcjcwMjMxOA==","avatar_url":"https://avatars2.githubusercontent.com/u/702318?v=4","gravatar_id":"","url":"https://api.github.com/users/basepi","html_url":"https://github.com/basepi","followers_url":"https://api.github.com/users/basepi/followers","following_url":"https://api.github.com/users/basepi/following{/other_user}","gists_url":"https://api.github.com/users/basepi/gists{/gist_id}","starred_url":"https://api.github.com/users/basepi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/basepi/subscriptions","organizations_url":"https://api.github.com/users/basepi/orgs","repos_url":"https://api.github.com/users/basepi/repos","events_url":"https://api.github.com/users/basepi/events{/privacy}","received_events_url":"https://api.github.com/users/basepi/received_events","type":"User","site_admin":false},"open_issues":1010,"closed_issues":2351,"state":"open","created_at":"2013-05-28T22:24:12Z","updated_at":"2018-06-15T14:11:59Z","due_on":null,"closed_at":null},"comments":8,"created_at":"2018-05-17T23:25:07Z","updated_at":"2018-06-15T14:11:59Z","closed_at":"2018-06-15T14:11:59Z","author_association":"CONTRIBUTOR","body":"### Description of Issue/Question\r\nWhen I try to set coalesce option `adaptive_rx` using the ethtool state module, it raises an exception.\r\n\r\n### Setup\r\n```\r\n# cat /srv/salt/test.sls \r\neth0:\r\n  ethtool.coalesce:\r\n    - name: eth0\r\n    - adaptive_rx: on\r\n```\r\n\r\n### Steps to Reproduce Issue\r\nApplying the above state.\r\n```\r\n# salt node state.apply test\r\nnode:\r\n----------\r\n          ID: eth0\r\n    Function: ethtool.coalesce\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/dist-packages/salt/state.py\", line 1878, in call\r\n                  **cdata['kwargs'])\r\n                File \"/usr/lib/python2.7/dist-packages/salt/loader.py\", line 1823, in wrapper\r\n                  return f(*args, **kwargs)\r\n                File \"/usr/lib/python2.7/dist-packages/salt/states/ethtool.py\", line 140, in coalesce\r\n                  __salt__['ethtool.set_coalesce'](name, **new)\r\n                File \"/usr/lib/python2.7/dist-packages/salt/modules/ethtool.py\", line 232, in set_coalesce\r\n                  return show_coalesce(devname)\r\n                File \"/usr/lib/python2.7/dist-packages/salt/modules/ethtool.py\", line 127, in show_coalesce\r\n                  for key, value in coalesce.items():\r\n              TypeError: an integer is required\r\n     Started: 22:27:01.586512\r\n    Duration: 2.23 ms\r\n     Changes:   \r\n\r\nSummary for node\r\n------------\r\nSucceeded: 0\r\nFailed:    1\r\n------------\r\nTotal states run:     1\r\nTotal run time:   2.230 ms\r\nERROR: Minions returned with non-zero exit code\r\n```\r\n\r\n\r\n### Versions Report\r\n```\r\nSalt Version:\r\n           Salt: 2018.3.0\r\n \r\nDependency Versions:\r\n           cffi: 0.8.6\r\n       cherrypy: Not Installed\r\n       dateutil: 2.2\r\n      docker-py: 1.10.6\r\n          gitdb: Not Installed\r\n      gitpython: Not Installed\r\n          ioflo: Not Installed\r\n         Jinja2: 2.9.4\r\n        libgit2: Not Installed\r\n        libnacl: Not Installed\r\n       M2Crypto: Not Installed\r\n           Mako: Not Installed\r\n   msgpack-pure: Not Installed\r\n msgpack-python: 0.4.2\r\n   mysql-python: 1.2.3\r\n      pycparser: 2.10\r\n       pycrypto: 2.6.1\r\n   pycryptodome: Not Installed\r\n         pygit2: Not Installed\r\n         Python: 2.7.9 (default, Jun 29 2016, 13:08:31)\r\n   python-gnupg: Not Installed\r\n         PyYAML: 3.11\r\n          PyZMQ: 14.4.0\r\n           RAET: Not Installed\r\n          smmap: Not Installed\r\n        timelib: Not Installed\r\n        Tornado: 4.2.1\r\n            ZMQ: 4.0.5\r\n \r\nSystem Versions:\r\n           dist: debian 8.10 \r\n         locale: UTF-8\r\n        machine: x86_64\r\n        release: 4.9.0-0.bpo.5-amd64\r\n         system: Linux\r\n        version: debian 8.10 \r\n```\r\n\r\n### Workaround / Patch\r\nI get it to work by modifying `salt/states/ethtool.py` at line 110 from \r\n\r\n```\r\n        # Retreive changes to made\r\n        for key, value in kwargs.items():\r\n            if key in ['adaptive_rx', 'adaptive_tx']:\r\n                value = value and \"on\" or \"off\"\r\n            if key in old and value != old[key]:\r\n                new.update({key: value})\r\n                diff.append('{0}: {1}'.format(key, value))\r\n```\r\nto\r\n```\r\n        # Retreive changes to made\r\n        for key, value in kwargs.items():\r\n            if key in old and value != old[key]:\r\n                new.update({key: value})\r\n                diff.append('{0}: {1}'.format(key, value))\r\n            if key in ['adaptive_rx', 'adaptive_tx']:\r\n                value = value and \"on\" or \"off\"\r\n```\r\n\r\nHowever I don't know if there is any side effects..\r\nIt can make a PR if this solution is OK.\r\n\r\n"}}
{"actor":{"display_login":"Ch3LL"}}