Chef Knife not saving changes with editor

Mohamed El Mahallawy

I want to create a role with knife. So I run:

> knife role create beautifulprayer
ERROR: RuntimeError: Please set EDITOR environment variable

No problem! Just add the editor. Afterwards:

> knife role create beautifulprayer

This opens the editor that I have set (subl) and goes ahead once the editor is open and propagates the call to the chef server, resulting in Created role[beautifulprayer] although the editor is still open and I have not saved anything. This happens with editing too where it results to Object unchanged, not saving while the editor is still open and no save happened.

This does NOT happen though when I use vim because knife waits for me to close VIM and then propogates the call to chef server. I'd like to use sublime but this isn't currently working because any changes and saving with sublime are not propagated or detected by knife.

Roland

You need to call your editor to "block" the current process and not fork another one. Usually this is somewhat described as "no fork", "foreground" or "wait" option:

Examples:

Sublime Text

export EDITOR="subl -w"

Atom:

export EDITOR="atom -f"

MacVim:

export EDITOR="mvim -f"

TextMate 2:

export EDITOR="mate -w"

When you've done your change, you need to close the editor and knife will pick up the change.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Chef knife configuration

From Dev

linux knife (chef) proxy

From Dev

Chef Knife - Error Synch with Chef Server

From Dev

troubles with data bags in chef/knife

From Dev

Chef Knife Commands 404 Not Found

From Dev

Chef knife plugin(s) not recognized?

From Dev

Chef knife site download return ContentLengthMismatch errors

From Dev

Chef knife create failing to create an API user

From Dev

chef server with knife backup showing error

From Dev

Chef/Knife running two environments on same machine

From Dev

Chef knife command not showing ssl subcommands

From Dev

getting error for knife bootstrap on ubuntu chef node

From Dev

Communication with chef server/chef node without using knife

From Dev

Communication with chef server/chef node without using knife

From Dev

Chef: Upgrade chef-client version during knife boostrap on node

From Dev

Chef: Running chef-client during knife upload / knife role from file

From Dev

How to use the Chef knife utility from a Windows batch file?

From Dev

chef knife commands show missing extensions on OSX El Capitan 10.11

From Dev

chef/knife (ruby) error: superclass mismatch for class Edit (TypeError)

From Dev

'knife: command not found' after chef-server installation

From Dev

How to set log level on knife winrm command in Chef

From Dev

Difference between 'knife cookbook create' and 'chef generate cookbook'?

From Dev

Chef knife upload get ERROR: Errno::ENOENT: No such file or directory

From Dev

How to use the Chef knife utility from a Windows batch file?

From Dev

Issues trying to bootstrap Chef for windows client with knife-windows

From Dev

managing chef data bag easier and faster using knife command

From Dev

Use knife ssh (Chef) with interaktive mode but also initial command

From Dev

can we launch more than one instance with chef through knife?

From Dev

chef knife environment from file not recognising older cookbook version

Related Related

  1. 1

    Chef knife configuration

  2. 2

    linux knife (chef) proxy

  3. 3

    Chef Knife - Error Synch with Chef Server

  4. 4

    troubles with data bags in chef/knife

  5. 5

    Chef Knife Commands 404 Not Found

  6. 6

    Chef knife plugin(s) not recognized?

  7. 7

    Chef knife site download return ContentLengthMismatch errors

  8. 8

    Chef knife create failing to create an API user

  9. 9

    chef server with knife backup showing error

  10. 10

    Chef/Knife running two environments on same machine

  11. 11

    Chef knife command not showing ssl subcommands

  12. 12

    getting error for knife bootstrap on ubuntu chef node

  13. 13

    Communication with chef server/chef node without using knife

  14. 14

    Communication with chef server/chef node without using knife

  15. 15

    Chef: Upgrade chef-client version during knife boostrap on node

  16. 16

    Chef: Running chef-client during knife upload / knife role from file

  17. 17

    How to use the Chef knife utility from a Windows batch file?

  18. 18

    chef knife commands show missing extensions on OSX El Capitan 10.11

  19. 19

    chef/knife (ruby) error: superclass mismatch for class Edit (TypeError)

  20. 20

    'knife: command not found' after chef-server installation

  21. 21

    How to set log level on knife winrm command in Chef

  22. 22

    Difference between 'knife cookbook create' and 'chef generate cookbook'?

  23. 23

    Chef knife upload get ERROR: Errno::ENOENT: No such file or directory

  24. 24

    How to use the Chef knife utility from a Windows batch file?

  25. 25

    Issues trying to bootstrap Chef for windows client with knife-windows

  26. 26

    managing chef data bag easier and faster using knife command

  27. 27

    Use knife ssh (Chef) with interaktive mode but also initial command

  28. 28

    can we launch more than one instance with chef through knife?

  29. 29

    chef knife environment from file not recognising older cookbook version

HotTag

Archive