Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disk ID #4

Open
oneingan opened this issue Feb 24, 2016 · 1 comment
Open

Disk ID #4

oneingan opened this issue Feb 24, 2016 · 1 comment

Comments

@oneingan
Copy link

Hi, I have an use case where hardware provisioner gives me SCSI controller number and disk port to initialize and format disk.

I make a custom fact to retrieve this info but maybe you are interested in support this feature also:

Facter.value(:disks).each do |disk, values|
      disks[disk] = {
        'scsiport' => Facter::Core::Execution.exec("find -L /dev/disk/by-path/ -samefile /dev/#{disk} | awk -F'[:.]' '{print $6}'"),
      }
    end

In future I'll use your implementation because your high quality code and standard de facto.
Thanks in advance and apologize my english.

@cygnusb
Copy link
Contributor

cygnusb commented Apr 9, 2016

We can use this, but you should implement this more proper. Please do not use a exec call, since this can be done by pure ruby code only. In addition the name of scsiport is a bit too generic. Please consider naming it a bit more reasonable. You might implement this and create a pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants