Skip to content

Conversation

@Guilhermeslucas
Copy link
Contributor

The powergraph now checks if ipmitool is installed.

@rpsene
Copy link

rpsene commented Jun 9, 2017

we could add a function to verify it, then reuse it when necessary:

def cmdexists(command):
"""check if a command exists"""
subp = subprocess.call("type " + command, shell=True,
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
return subp == 0

This will return True or False. True if the subp output for 0 (sucess), 1 otherwise.

Copy link

@rpsene rpsene left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change request in the comments.

@Guilhermeslucas
Copy link
Contributor Author

Changed the command to become more generic!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants