-
Notifications
You must be signed in to change notification settings - Fork 3
Fix databag item update for recent versions of chef (>10) and add commis/wsgi.py #14
base: master
Are you sure you want to change the base?
Conversation
raise ChefAPIError(500, 'Name mismatch in data bag item') | ||
item = self.get_item_or_404(bag_name, name) | ||
update(item, data=request.raw_post_data) | ||
update(item, data=json.dumps(data, indent=4)) |
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.
Why the indent? Might as well make it smaller in the DB :)
You're right, there's really no reason at all to have an indent here. |
…y ended up having the same path
…y ended up having the same path
… existing version
I added fixes for issues 15 & 16 regarding file upload. |
And yet you haven't fixed the indent so I can't merge it ;-) |
I'm also not sure your upload logic is correct. The point is that if the checksum already exists on the server it shouldn't be uploaded again, there should just be a new metadata entry in the cookbook version pointing at the same file data. |
Hi, Does this sound ok to you? Cheers, (*) This can happen if someone modifies a cookbook and forgets to change its version (or does not want to, for some reason) and then uploads the cookbook. Before my patch, I ended up with two cookbook_files for the same path (one for the old content, one for the new content). |
Here's a fix for the databag item update bug discussed in Issue #13 (#13).
I also added wsgi.py... it can't hurt ! ;-)
ps: I pushed 2 untested and buggy commits before getting the thing to work in the 3rd commit. I know I could hack around the git history to remove these, but I don't have much time, so I hope you won't mind.