invoking knife in a ruby class

后端 未结 4 1052
迷失自我
迷失自我 2021-02-11 01:38

I\'d like to create a nice wrapper class around knife to allow a program to run knife commands in a readable manner. I\'m currently trying to use the knife.rb file in the chef

4条回答
  •  执念已碎
    2021-02-11 02:16

    It looks like Knife is expecting a Hash where you have 'disable-editing'. Try this:

    knife.run(['client', 'create', 'new-client'], {:"disable-editing" => true})
    

    When something like this happens, try looking at the Array/Hash api docs to look for the method the error is spitting out. That will give you an idea of what should be going into that parameter (if you don't have documentation for the library and the source is hard to read).

提交回复
热议问题