{"action":"created","issue":{"url":"https://api.github.com/repos/rockstor/rockstor-core/issues/675","labels_url":"https://api.github.com/repos/rockstor/rockstor-core/issues/675/labels{/name}","comments_url":"https://api.github.com/repos/rockstor/rockstor-core/issues/675/comments","events_url":"https://api.github.com/repos/rockstor/rockstor-core/issues/675/events","html_url":"https://github.com/rockstor/rockstor-core/pull/675","id":87064851,"number":675,"title":"Issue#673 kvm virtio drive serial","user":{"login":"phillxnet","id":2521585,"avatar_url":"https://avatars.githubusercontent.com/u/2521585?v=3","gravatar_id":"","url":"https://api.github.com/users/phillxnet","html_url":"https://github.com/phillxnet","followers_url":"https://api.github.com/users/phillxnet/followers","following_url":"https://api.github.com/users/phillxnet/following{/other_user}","gists_url":"https://api.github.com/users/phillxnet/gists{/gist_id}","starred_url":"https://api.github.com/users/phillxnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phillxnet/subscriptions","organizations_url":"https://api.github.com/users/phillxnet/orgs","repos_url":"https://api.github.com/users/phillxnet/repos","events_url":"https://api.github.com/users/phillxnet/events{/privacy}","received_events_url":"https://api.github.com/users/phillxnet/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-06-10T18:37:36Z","updated_at":"2015-06-18T00:07:04Z","closed_at":"2015-06-18T00:05:08Z","pull_request":{"url":"https://api.github.com/repos/rockstor/rockstor-core/pulls/675","html_url":"https://github.com/rockstor/rockstor-core/pull/675","diff_url":"https://github.com/rockstor/rockstor-core/pull/675.diff","patch_url":"https://github.com/rockstor/rockstor-core/pull/675.patch"},"body":"Patch to provide an additional mechanism to retrieve drive serial numbers.  Currently only seems necessary for virtio drives as lsblk fails to retrieve their serial which we need.  So when existing mechanisms fail to get a drive serial this patch tries again with for example a cat /sys/block/vda/serial.\r\nThis entry seems not to exist with other drive types and we have a fail through to return an empty string if no serial entry is found so (hopefully) no worse off anyway if accidentally called with another device type.\r\nShould only be called when existing mechanism fails to get a serial for a block device listed in lsblk.\r\n\r\nN.B. does not address the issue of being able to install on a vda (rather than an sda) device."},"comment":{"url":"https://api.github.com/repos/rockstor/rockstor-core/issues/comments/112983668","html_url":"https://github.com/rockstor/rockstor-core/pull/675#issuecomment-112983668","issue_url":"https://api.github.com/repos/rockstor/rockstor-core/issues/675","id":112983668,"user":{"login":"schakrava","id":1123552,"avatar_url":"https://avatars.githubusercontent.com/u/1123552?v=3","gravatar_id":"","url":"https://api.github.com/users/schakrava","html_url":"https://github.com/schakrava","followers_url":"https://api.github.com/users/schakrava/followers","following_url":"https://api.github.com/users/schakrava/following{/other_user}","gists_url":"https://api.github.com/users/schakrava/gists{/gist_id}","starred_url":"https://api.github.com/users/schakrava/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/schakrava/subscriptions","organizations_url":"https://api.github.com/users/schakrava/orgs","repos_url":"https://api.github.com/users/schakrava/repos","events_url":"https://api.github.com/users/schakrava/events{/privacy}","received_events_url":"https://api.github.com/users/schakrava/received_events","type":"User","site_admin":false},"created_at":"2015-06-18T00:07:04Z","updated_at":"2015-06-18T00:07:04Z","body":"@phillxnet your reasoning for cat sounds fair enough, thanks for explaining it. My tendency is to use python if I can, but that's just me. no need to re-write your code. one other thing popped out with regards to return str(out)[2:-2] . since out is a list where the first element is our serial number, you can just return out[0] . It's a trivial change and because I am closing out for the release update, I made that change myself and merged. See you in the next pull request and thanks again!"}}