Skip to content

Instantly share code, notes, and snippets.

@ancorgs
Created March 18, 2016 08:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ancorgs/9c628ef0f4fa717a2817 to your computer and use it in GitHub Desktop.
Save ancorgs/9c628ef0f4fa717a2817 to your computer and use it in GitHub Desktop.
query = DevicegraphQuery.new(a_devicegraph)
fine_query = query.with_disk(name: ["/dev/sda", "/dev/sdb"])
more_fine_query = fine_query.with_partition(type: :primary)
part_query = query.with_partition(name: ["/dev/sda2", "/dev/sdc3"])
# All these calls return arrays
query.filesystems # all the file systems in the devicegraph
fine_query.filesystems # Filesystems in the chosen disks
more_fine_query.filesystems # fs in primary parts of chosen disks
part_query.filesystems # Filesystems in sda2 and sdc3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment