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

knife diff and upload do not understand .rb files #67

Open
jkeiser opened this issue Aug 20, 2012 · 8 comments
Open

knife diff and upload do not understand .rb files #67

jkeiser opened this issue Aug 20, 2012 · 8 comments
Labels

Comments

@jkeiser
Copy link
Owner

jkeiser commented Aug 20, 2012

You can load environments and roles with .rb files, but knife diff assumes all files were loaded via .json files. This means that if you have environments/blah.rb, and you have a "blah" environment, knife diff will not diff the two and will instead think your local copy "deleted" the environment.

There is a distinct (but intimately related) issue regarding knife download: when there is an entry in the server that is not on the client, should we download that as json or rb? Should we "guess" based on the type of surrounding files?

@yfeldblum
Copy link

Don't guess. Default to json.

But defaults must only be defaults. Defaults must be changeable, and defaults must be overridable.

Provide a config option for changing the default. The config option should accept a binary, but should also accept further customization via either a regex matching the role/env name or a proc to which is passed the role/env name.

Provide a CLI option for switching per-invocation.

@jkeiser
Copy link
Owner Author

jkeiser commented Aug 20, 2012

Great idea! The ability to specify that different directories have different defaults will probably be very useful to some people. And it puts the expression of file extension where it belongs: on the server. I can imagine automatic detection of this (the presence of .rb and absence of .json is a clear indicator of preference), but that seems like a separate issue.

@jkeiser
Copy link
Owner Author

jkeiser commented Jan 21, 2013

This should be a good bit easier now, at least from a data format perspective: the data_handler classes (available as a data_handler attribute on most file_system entries) have to_ruby and from_ruby methods. The plumbing to allow format=rb in various directories still needs to be built, but at least there's that to plug into now.

@mattray
Copy link

mattray commented Jan 23, 2014

vagrant-chef-zero would like this fixed someday, then they can drop the Chef dependency.
schubergphilis/vagrant-chef-zero#22 (comment)

@kramvan1
Copy link

A second vote for chef-zero support for this. Why was this closed without a fix? Other issue was also closed.

@coderanger
Copy link
Collaborator

@kramvan1 This ticket isn't closed, just no one has gotten around to working on it yet.

@tas50
Copy link

tas50 commented Jul 8, 2014

Since knife-essentials is merged into core chef should this bug be moved to the chef project or is it still necessary that it be fixed here?

@jkeiser
Copy link
Owner Author

jkeiser commented Jul 8, 2014

Yeah, everything in here needs to move to the chef project (at least everything we still intend to fix).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants