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

Review run_command function and clean up #102

Merged
merged 2 commits into from
Jun 16, 2019
Merged

Review run_command function and clean up #102

merged 2 commits into from
Jun 16, 2019

Conversation

rhodesn
Copy link
Contributor

@rhodesn rhodesn commented Jun 16, 2019

No description provided.

rhodesn added 2 commits June 16, 2019 15:01
As per the previous PR, update run_command to use Popen.communicate()
in case of large output from the command. The stdout.readlines() would
prevent blocking, however communicate ensures all handles are cleaned up
once the process has completed.

Also tidy up the code inside run_command.
run_command accepts a sort argument which causes the line output from
the command to be sorted. Can only do this with a list hence we're
moving back to stdout.readlines() which creates a list of lines.

Also clean up the subprocess.Popen call.
@rhodesn rhodesn merged commit 18f7a29 into rackerlabs:master Jun 16, 2019
@rhodesn rhodesn deleted the update-command-output branch June 16, 2019 15:40
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

Successfully merging this pull request may close these issues.

1 participant