-
Notifications
You must be signed in to change notification settings - Fork 681
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
first pass at collecting command output for demo #977
Conversation
704d86e
to
2821dae
Compare
@@ -0,0 +1,13 @@ | |||
# encoding: utf-8 | |||
require 'open3' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets use https://github.com/chef/mixlib-shellout or
backend = Train.create('local', target_config)
# start or reuse a connection
conn = backend.connection
# loop around commands
cmd = conn.run_command('inspec version')
cmd.stdout
conn.close
under the hood, train is using mixlib-shellout
@Vj this looks great, lets just switch the libs, running it via train would allow us build a predefined container that is including the latest inspec later. This would make results consistent across operating systems and CI pipelines. |
Once we have the basic commands covered, LGTM |
6604a8e
to
63b433d
Compare
@chris-rock updated to use train |
63b433d
to
2982fba
Compare
Thanks @vjeffrey for this great improvement! I'll create a ticket for another iteration :-) |
# loop around commands | ||
cmd = conn.run_command(command) | ||
cmd.stdout | ||
conn.close |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move
backend = Train.create('local')
conn = backend.connection
and conn.close
out of the loop
heya peoples can you take a look and let me know what you think of this?? we would want the files to actually be saved somewhere in the www/ folder that the demo branch will introduce and then pull them in with the html....so i would need to make sure this overwrites too -- but i wanted to make sure something like this would be ok??. thank ya :)