Questions tagged [mixlib-shellout]

10 questions
4
votes
1 answer

Trying to run execute and batch as specified user on Windows with Chef

I am using Chef resource Execute on Windows. When I set the user attribute of the resource, I get this error: Mixlib::ShellOut::InvalidCommandOption -------------------------------------- You must supply both a username and password when supplying…
Danielle
  • 54
  • 1
  • 3
2
votes
2 answers

How to log script output to STDOUT and a file

I have the following Ruby block: ruby_block "Validate" do block do require "mixlib/shellout" begin cmd = Mixlib::ShellOut.new("/usr/local/bin/someScript.py", :timeout => 3600) cmd.live_stream = STDOUT cmd.run_command …
Jakir00
  • 2,023
  • 4
  • 20
  • 32
2
votes
1 answer

Is it possible to use so = shellout("linux cmd") outside of Chef in ruby script?

I'm curious, is there a possibility to use shellout in ruby scripts outside of Chef? How to set up this?
laimison
  • 1,409
  • 3
  • 17
  • 39
2
votes
1 answer

When to use shellout?

When is it appropriate to use shellout in a recipe instead of bash blocks or execute? I'm inclining to using it by default for all outside calls, because of its logging, but the verbosity of the command are a disadvantage.
Oin
  • 6,951
  • 2
  • 31
  • 55
1
vote
1 answer

Chef ruby_block ShellOut mysql result stdout forever empty

have an next case: test3 = Mixlib::ShellOut.new("echo '1'") test4 = Mixlib::ShellOut.new("mysql -u root --silent --skip-column-names --password='rootpass' -e 'some sql;'") test3.run_command test4.run_command puts test3.stdout # => 1 puts…
1
vote
1 answer

chef shell out to hash (separator is new line)

I just have a recipe with content: echo_example = shell_out("echo "line 1\nline 2") if echo_example.exitstatus == 0 && echo_example node.rm('test') node.set['test'] = [echo_example.stdout.chomp] end Attribute output with knife is: …
laimison
  • 1,409
  • 3
  • 17
  • 39
1
vote
1 answer

Ruby on Windows: uninitialized constant Process::Functions::FFI (NameError)

I'm running ruby on windows, having installed 1.9.3 via the ruby installer. I've installed the chef ruby gem, but I cannot use chef-client or knife from the command line. Here's the abridged output from the command line. What's going…
Nick
  • 6,366
  • 5
  • 43
  • 62
0
votes
1 answer

Parsing issue with ruby Mixlib::ShellOut in chef

I'm trying to extend an existing cookbook where we use Mixlib::ShellOut to collect a fair amount of information about an Oracle install. Mostly it just works. I'm trying to add a node attribute for where TFA is running - because that can vary…
stephan
  • 45
  • 1
  • 8
0
votes
0 answers

Getting an empty string as the output of a piped zypper search Linux command while executing it in ruby using backticks or Mixlib::ShellOut

I’m trying to run a piped Linux command in ruby by enclosing it in backticks`` and by using Mixlib::ShellOut. But in both the cases, I'm getting an empty string as the output even though the actual output looks like this i |…
0
votes
0 answers

the table view dosen't show the data in javafx

I've made correct code but not showing the result. Is The table empty or hide at the end? public class FXMLResultController implements Initializable { @FXML //You shouldn't make a new TableView //TableView Tblresult = new TableView(); //Just…
M0TRIX
  • 253
  • 5
  • 19