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

implementing ipmicheck #9

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

implementing ipmicheck #9

wants to merge 4 commits into from

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.

2 participants