Created
May 8, 2017 09:04
-
-
Save anonymous/7bab3155b373b1a12d5d49281f982989 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def checkIfPTExists(pt_name) | |
hosts = %x( /usr/bin/hammer --output=json partition-table info --name "#{pt_name}" 2>/dev/null ) | |
exists = false | |
if $?.exitstatus == 0 | |
hosts = JSON.parse(hosts) | |
exists = true if hosts["Name"] == pt_name | |
end | |
puts exists | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment