{"action":"created","issue":{"url":"https://api.github.com/repos/saltstack/salt/issues/28089","labels_url":"https://api.github.com/repos/saltstack/salt/issues/28089/labels{/name}","comments_url":"https://api.github.com/repos/saltstack/salt/issues/28089/comments","events_url":"https://api.github.com/repos/saltstack/salt/issues/28089/events","html_url":"https://github.com/saltstack/salt/pull/28089","id":112152825,"number":28089,"title":"Contribution: SysFS module","user":{"login":"The-Loeki","id":426731,"avatar_url":"https://avatars.githubusercontent.com/u/426731?v=3","gravatar_id":"","url":"https://api.github.com/users/The-Loeki","html_url":"https://github.com/The-Loeki","followers_url":"https://api.github.com/users/The-Loeki/followers","following_url":"https://api.github.com/users/The-Loeki/following{/other_user}","gists_url":"https://api.github.com/users/The-Loeki/gists{/gist_id}","starred_url":"https://api.github.com/users/The-Loeki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/The-Loeki/subscriptions","organizations_url":"https://api.github.com/users/The-Loeki/orgs","repos_url":"https://api.github.com/users/The-Loeki/repos","events_url":"https://api.github.com/users/The-Loeki/events{/privacy}","received_events_url":"https://api.github.com/users/The-Loeki/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/saltstack/salt/labels/Execution%20Module","name":"Execution Module","color":"006b75"},{"url":"https://api.github.com/repos/saltstack/salt/labels/Pending%20Changes","name":"Pending Changes","color":"c7def8"},{"url":"https://api.github.com/repos/saltstack/salt/labels/Platform","name":"Platform","color":"fef2c0"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-10-19T14:12:15Z","updated_at":"2015-12-21T17:23:19Z","closed_at":"2015-10-20T16:34:40Z","pull_request":{"url":"https://api.github.com/repos/saltstack/salt/pulls/28089","html_url":"https://github.com/saltstack/salt/pull/28089","diff_url":"https://github.com/saltstack/salt/pull/28089.diff","patch_url":"https://github.com/saltstack/salt/pull/28089.patch"},"body":"I'd like this module to be considered for inclusion.\r\n\r\nIt's a generic wrap around SysFS interfaces. It's able to read out (batches of) SysFS values, and distill interfaces from them for easy utilization in other modules.\r\n\r\nIn particular the `interfaces` function is *very* useful in this regard;\r\n\r\n```\r\nsalt-call sysfs.interfaces block/bcache0/bcache\r\nlocal:\r\n    ----------\r\n    r:\r\n        - state\r\n        - partial_stripes_expensive\r\n        - writeback_rate_debug\r\n        - stripe_size\r\n        - dirty_data\r\n        - stats_five_minute/cache_hits\r\n        - stats_five_minute/cache_bypass_misses\r\n        - stats_five_minute/bypassed\r\n        - stats_five_minute/cache_readaheads\r\n        - stats_five_minute/cache_hit_ratio\r\n        - stats_five_minute/cache_miss_collisions\r\n        - stats_five_minute/cache_misses\r\n        - stats_five_minute/cache_bypass_hits\r\n        - stats_total/cache_hits\r\n        - stats_total/cache_bypass_misses\r\n        - stats_total/bypassed\r\n        - stats_total/cache_readaheads\r\n        - stats_total/cache_hit_ratio\r\n        - stats_total/cache_miss_collisions\r\n        - stats_total/cache_misses\r\n        - stats_total/cache_bypass_hits\r\n        - stats_day/cache_hits\r\n        - stats_day/cache_bypass_misses\r\n        - stats_day/bypassed\r\n        - stats_day/cache_readaheads\r\n        - stats_day/cache_hit_ratio\r\n        - stats_day/cache_miss_collisions\r\n        - stats_day/cache_misses\r\n        - stats_day/cache_bypass_hits\r\n        - stats_hour/cache_hits\r\n        - stats_hour/cache_bypass_misses\r\n        - stats_hour/bypassed\r\n        - stats_hour/cache_readaheads\r\n        - stats_hour/cache_hit_ratio\r\n        - stats_hour/cache_miss_collisions\r\n        - stats_hour/cache_misses\r\n        - stats_hour/cache_bypass_hits\r\n    rw:\r\n        - writeback_rate\r\n        - writeback_rate_update_seconds\r\n        - cache_mode\r\n        - writeback_delay\r\n        - label\r\n        - writeback_running\r\n        - writeback_metadata\r\n        - running\r\n        - writeback_rate_p_term_inverse\r\n        - sequential_cutoff\r\n        - writeback_percent\r\n        - writeback_rate_d_term\r\n        - readahead\r\n    w:\r\n        - stop\r\n        - clear_stats\r\n        - attach\r\n        - detach\r\n```\r\n\r\nNow you immediately know what you can do with this dev and start doing it w00t :):\r\n\r\n```\r\nintf = __salt__['sysfs.interfaces']('block/bcache0/bcache')\r\n\r\nstats = [key for key in intf['r] if key.startswith('stats')]\r\n\r\nstats = __salt__['sysfs.read']('block/bcache0/bcache', stats)\r\n```\r\nThe module's been running fine on 2014.7 & 2015.8 on a variety of Ubuntu's & CentOS's for quite some time now."},"comment":{"url":"https://api.github.com/repos/saltstack/salt/issues/comments/166364824","html_url":"https://github.com/saltstack/salt/pull/28089#issuecomment-166364824","issue_url":"https://api.github.com/repos/saltstack/salt/issues/28089","id":166364824,"user":{"login":"The-Loeki","id":426731,"avatar_url":"https://avatars.githubusercontent.com/u/426731?v=3","gravatar_id":"","url":"https://api.github.com/users/The-Loeki","html_url":"https://github.com/The-Loeki","followers_url":"https://api.github.com/users/The-Loeki/followers","following_url":"https://api.github.com/users/The-Loeki/following{/other_user}","gists_url":"https://api.github.com/users/The-Loeki/gists{/gist_id}","starred_url":"https://api.github.com/users/The-Loeki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/The-Loeki/subscriptions","organizations_url":"https://api.github.com/users/The-Loeki/orgs","repos_url":"https://api.github.com/users/The-Loeki/repos","events_url":"https://api.github.com/users/The-Loeki/events{/privacy}","received_events_url":"https://api.github.com/users/The-Loeki/received_events","type":"User","site_admin":false},"created_at":"2015-12-21T17:23:19Z","updated_at":"2015-12-21T17:23:19Z","body":"<bump> @cachedout ?"}}