{"action":"created","issue":{"url":"https://api.github.com/repos/saltstack/salt/issues/29881","labels_url":"https://api.github.com/repos/saltstack/salt/issues/29881/labels{/name}","comments_url":"https://api.github.com/repos/saltstack/salt/issues/29881/comments","events_url":"https://api.github.com/repos/saltstack/salt/issues/29881/events","html_url":"https://github.com/saltstack/salt/pull/29881","id":123184534,"number":29881,"title":"rework salt.module.zpool","user":{"login":"sjorge","id":379665,"avatar_url":"https://avatars.githubusercontent.com/u/379665?v=3","gravatar_id":"","url":"https://api.github.com/users/sjorge","html_url":"https://github.com/sjorge","followers_url":"https://api.github.com/users/sjorge/followers","following_url":"https://api.github.com/users/sjorge/following{/other_user}","gists_url":"https://api.github.com/users/sjorge/gists{/gist_id}","starred_url":"https://api.github.com/users/sjorge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sjorge/subscriptions","organizations_url":"https://api.github.com/users/sjorge/orgs","repos_url":"https://api.github.com/users/sjorge/repos","events_url":"https://api.github.com/users/sjorge/events{/privacy}","received_events_url":"https://api.github.com/users/sjorge/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/saltstack/salt/labels/Pending%20Discussion","name":"Pending Discussion","color":"c7def8"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-12-20T21:32:26Z","updated_at":"2015-12-21T17:47:05Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/saltstack/salt/pulls/29881","html_url":"https://github.com/saltstack/salt/pull/29881","diff_url":"https://github.com/saltstack/salt/pull/29881.diff","patch_url":"https://github.com/saltstack/salt/pull/29881.patch"},"body":"Part of #28779, the zpool module has been reworked to parse data where possible.\r\nMissing feature were also implemented.\r\n\r\n```bash\r\n/opt/local/salt/bin/salt-call --local zpool.status zones\r\n```\r\n```yaml\r\nlocal:\r\n    ----------\r\n    zones:\r\n        ----------\r\n        config:\r\n            ----------\r\n            zones:\r\n                ----------\r\n                cksum:\r\n                    0\r\n                mirror-0:\r\n                    ----------\r\n                    c2t0d0:\r\n                        ----------\r\n                        cksum:\r\n                            0\r\n                        read:\r\n                            0\r\n                        state:\r\n                            ONLINE\r\n                        write:\r\n                            0\r\n                    c2t1d0:\r\n                        ----------\r\n                        cksum:\r\n                            0\r\n                        read:\r\n                            0\r\n                        state:\r\n                            ONLINE\r\n                        write:\r\n                            0\r\n                    cksum:\r\n                        0\r\n                    read:\r\n                        0\r\n                    state:\r\n                        ONLINE\r\n                    write:\r\n                        0\r\n                read:\r\n                    0\r\n                state:\r\n                    ONLINE\r\n                write:\r\n                    0\r\n        errors:\r\n            No known data errors\r\n        scan:\r\n            scrub repaired 0 in 0h5m with 0 errors on Mon Dec 14 02\r\n        state:\r\n            ONLINE\r\n```\r\n\r\n```bash\r\n/opt/local/salt/bin/salt-call --local zpool.iostat zones sample_time=60\r\n```\r\n```yaml\r\nlocal:\r\n    ----------\r\n    zones:\r\n        ----------\r\n        zones:\r\n            ----------\r\n            bandwith-read:\r\n                0\r\n            bandwith-write:\r\n                690K\r\n            capacity-alloc:\r\n                42.7G\r\n            capacity-free:\r\n                68.3G\r\n            mirror:\r\n                ----------\r\n                bandwith-read:\r\n                    0\r\n                bandwith-write:\r\n                    690K\r\n                c2t0d0:\r\n                    ----------\r\n                    bandwith-read:\r\n                        0\r\n                    bandwith-write:\r\n                        692K\r\n                    operations-read:\r\n                        0\r\n                    operations-write:\r\n                        12\r\n                c2t1d0:\r\n                    ----------\r\n                    bandwith-read:\r\n                        0\r\n                    bandwith-write:\r\n                        692K\r\n                    operations-read:\r\n                        0\r\n                    operations-write:\r\n                        12\r\n                capacity-alloc:\r\n                    42.7G\r\n                capacity-free:\r\n                    68.3G\r\n                operations-read:\r\n                    0\r\n                operations-write:\r\n                    20\r\n            operations-read:\r\n                0\r\n            operations-write:\r\n                20\r\n```\r\n\r\n```bash\r\n/opt/local/salt/bin/salt-call --local zpool.detach test /tmp/disk2\r\n```\r\n```yaml\r\nlocal:\r\n    ----------\r\n    test:\r\n        ----------\r\n        detached:\r\n            - /tmp/disk2\r\n```\r\n\r\n```bash\r\n/opt/local/salt/bin/salt-call --local zpool.attach test /tmp/disk1 /tmp/disk2 force=True\r\n```\r\n```yaml\r\nlocal:\r\n    ----------\r\n    test:\r\n        ----------\r\n        attached:\r\n            - /tmp/disk2\r\n```\r\n\r\n```bash\r\n/opt/local/salt/bin/salt-call --local zpool.reguid test\r\n```\r\n```yaml\r\nlocal:\r\n    ----------\r\n    test:\r\n        reguided\r\n```\r\n\r\n```bash\r\n/opt/local/salt/bin/salt-call --local zpool.reopen test\r\n```\r\n```yaml\r\nlocal:\r\n    ----------\r\n    test:\r\n        reopened\r\n```\r\n\r\n```bash\r\n /opt/local/salt/bin/salt-call --local zpool.get test readonly\r\n```\r\n```yaml\r\nlocal:\r\n    ----------\r\n    test:\r\n        ----------\r\n        readonly:\r\n            off\r\n```\r\n\r\n```bash\r\n /opt/local/salt/bin/salt-call --local zpool.get test\r\n```\r\n```yaml\r\nlocal:\r\n    ----------\r\n    test:\r\n        ----------\r\n        allocated:\r\n            118K\r\n        altroot:\r\n            -\r\n        autoexpand:\r\n            off\r\n        autoreplace:\r\n            off\r\n        bootfs:\r\n            -\r\n        cachefile:\r\n            -\r\n        capacity:\r\n            0%\r\n        comment:\r\n            -\r\n        dedupditto:\r\n            0\r\n        dedupratio:\r\n            1.00x\r\n        delegation:\r\n            on\r\n        expandsize:\r\n            -\r\n        failmode:\r\n            wait\r\n        feature@async_destroy:\r\n            enabled\r\n        feature@bookmarks:\r\n            enabled\r\n        feature@edonr:\r\n            enabled\r\n        feature@embedded_data:\r\n            active\r\n        feature@empty_bpobj:\r\n            enabled\r\n        feature@enabled_txg:\r\n            active\r\n        feature@extensible_dataset:\r\n            enabled\r\n        feature@filesystem_limits:\r\n            enabled\r\n        feature@hole_birth:\r\n            active\r\n        feature@large_blocks:\r\n            enabled\r\n        feature@lz4_compress:\r\n            active\r\n        feature@multi_vdev_crash_dump:\r\n            enabled\r\n        feature@sha512:\r\n            enabled\r\n        feature@skein:\r\n            enabled\r\n        feature@spacemap_histogram:\r\n            active\r\n        fragmentation:\r\n            0%\r\n        free:\r\n            224M\r\n        freeing:\r\n            0\r\n        guid:\r\n            5784117219602689890\r\n        health:\r\n            ONLINE\r\n        leaked:\r\n            0\r\n        listsnapshots:\r\n            off\r\n        readonly:\r\n            off\r\n        size:\r\n            224M\r\n        version:\r\n            -\r\n```\r\n\r\n```bash\r\n/opt/local/salt/bin/salt-call --local zpool.set test comment 'hello world'\r\n```\r\n```yaml\r\nlocal:\r\n    ----------\r\n    test:\r\n        ----------\r\n        comment:\r\n            'hello world'\r\n```\r\n\r\n```bash\r\n/opt/local/salt/bin/salt-call --local zpool.history test\r\n```\r\n```yaml\r\nlocal:\r\n    ----------\r\n    test:\r\n        - 2015-12-20.19:34:07 zpool create -f test /tmp/disk0\r\n        - 2015-12-20.19:52:52 zpool add -f test /tmp/disk1\r\n        - 2015-12-20.19:54:37 zpool attach -f test /tmp/disk1 /tmp/disk2\r\n        - 2015-12-20.19:54:48 zpool offline test /tmp/disk1\r\n        - 2015-12-20.19:54:57 zpool online test /tmp/disk1\r\n        - 2015-12-20.19:55:05 zpool online test /tmp/disk1 /tmp/disk0\r\n        - 2015-12-20.20:01:05 zpool offline test /tmp/disk1\r\n        - 2015-12-20.20:01:11 zpool offline test /tmp/disk1\r\n        - 2015-12-20.20:12:47 zpool online test /tmp/disk1\r\n        - 2015-12-20.20:16:32 zpool offline test /tmp/disk1\r\n        - 2015-12-20.20:18:46 zpool online test /tmp/disk1\r\n        - 2015-12-20.20:19:11 zpool reguid test\r\n        - 2015-12-20.20:21:31 zpool reopen test\r\n        - 2015-12-20.20:45:17 zpool set autoexpand=on test\r\n        - 2015-12-20.20:45:28 zpool set autoexpand=off test\r\n        - 2015-12-20.21:36:17 zpool detach test /tmp/disk2\r\n        - 2015-12-20.21:38:12 zpool attach -f test /tmp/disk1 /tmp/disk2\r\n        - 2015-12-20.21:38:29 zpool reguid test\r\n        - 2015-12-20.21:38:54 zpool reopen test\r\n        - 2015-12-20.21:41:28 zpool set comment=hello test\r\n        - 2015-12-20.21:44:25 zpool set comment=hello world test\r\n```"},"comment":{"url":"https://api.github.com/repos/saltstack/salt/issues/comments/166372154","html_url":"https://github.com/saltstack/salt/pull/29881#issuecomment-166372154","issue_url":"https://api.github.com/repos/saltstack/salt/issues/29881","id":166372154,"user":{"login":"nmadhok","id":3374962,"avatar_url":"https://avatars.githubusercontent.com/u/3374962?v=3","gravatar_id":"","url":"https://api.github.com/users/nmadhok","html_url":"https://github.com/nmadhok","followers_url":"https://api.github.com/users/nmadhok/followers","following_url":"https://api.github.com/users/nmadhok/following{/other_user}","gists_url":"https://api.github.com/users/nmadhok/gists{/gist_id}","starred_url":"https://api.github.com/users/nmadhok/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nmadhok/subscriptions","organizations_url":"https://api.github.com/users/nmadhok/orgs","repos_url":"https://api.github.com/users/nmadhok/repos","events_url":"https://api.github.com/users/nmadhok/events{/privacy}","received_events_url":"https://api.github.com/users/nmadhok/received_events","type":"User","site_admin":false},"created_at":"2015-12-21T17:47:05Z","updated_at":"2015-12-21T17:47:05Z","body":"@cachedout Looks good to me except for the failing test. I would also suggest updating the unit tests as well to work with the changes to the functions. "}}