Skip to content

Commit

Permalink
Merge commit 'btm/master' into internal-0.7-branch
Browse files Browse the repository at this point in the history
  • Loading branch information
Thom May committed Dec 31, 2009
2 parents 54f35e4 + db0e65b commit 58352d9
Show file tree
Hide file tree
Showing 37 changed files with 1,250 additions and 1,211 deletions.
20 changes: 20 additions & 0 deletions CHANGELOG
@@ -1,3 +1,23 @@
Tue, 29 Dec 2009 19:51:02 +0000

Release Notes - Chef - Version 0.7.16wt1

** This is an unofficial release **
** Bryan McLellan <btm@loftninjas.org> **

** Bug
* [CHEF-706] - mount provider fails to mount samba/cifs devices (Device does not exist)
* [CHEF-634] - UI fails silently when unable to save node
* [CHEF-659] - UI expands some escaped characters from JSON, then fails to encode them again

Tue Dec 22 14:55:25 PST 2009

Release Notes - Chef - Version 0.7.16

** Bug
* [CHEF-686] - chef-{server,client,indexer} creating world writable files and directories
* [CHEF-812] - file backup permissions less secure than file

Mon Sep 27 6:22:00 NZST 2009

Release Notes - Chef - Version 0.7.14
Expand Down
2 changes: 1 addition & 1 deletion chef-server-slice/Rakefile
Expand Up @@ -9,7 +9,7 @@ rescue LoadError
end

GEM_NAME = "chef-server-slice"
CHEF_SERVER_VERSION="0.7.14"
CHEF_SERVER_VERSION="0.7.16wt1"
AUTHOR = "Opscode"
EMAIL = "chef@opscode.com"
HOMEPAGE = "http://wiki.opscode.com/display/chef"
Expand Down
9 changes: 6 additions & 3 deletions chef-server-slice/app/controllers/nodes.rb
Expand Up @@ -86,12 +86,13 @@ def create
@node.run_list params[:for_node]
@node.save
redirect(slice_url(:nodes), :message => { :notice => "Created Node #{@node.name}" })
rescue
rescue Exception => e
Chef::Log.error("Exception creating node: #{e.message}")
@node.attribute = JSON.parse(params[:attributes])
@available_recipes = get_available_recipes
@available_roles = Chef::Role.list.sort
@run_list = params[:for_node]
@_message = { :error => $! }
@_message = { :error => "Exception raised creating node, please check logs for details" }
render :new
end
end
Expand All @@ -117,11 +118,13 @@ def update
@node.save
@_message = { :notice => "Updated Node" }
render :show
rescue
rescue Exception => e
Chef::Log.error("Exception updating node: #{e.message}")
@available_recipes = get_available_recipes
@available_roles = Chef::Role.list.sort
@run_list = Chef::RunList.new
@run_list.reset(params[:for_node])
@_message = { :error => "Exception raised updating node, please check logs for details" }
render :edit
end
end
Expand Down
16 changes: 14 additions & 2 deletions chef-server-slice/app/controllers/roles.rb
Expand Up @@ -76,14 +76,24 @@ def create
@role.override_attributes(JSON.parse(params[:override_attributes])) if params[:override_attributes] != ''
@role.save
redirect(slice_url(:roles), :message => { :notice => "Created Role #{@role.name}" })
rescue ArgumentError
rescue ArgumentError => ae
Chef::Log.error("Exception creating role: #{ae.message}")
@available_recipes = get_available_recipes
@role = Chef::Role.new
@role.default_attributes(JSON.parse(params[:default_attributes])) if params[:default_attributes] != ''
@role.override_attributes(JSON.parse(params[:override_attributes])) if params[:override_attributes] != ''
@current_recipes = params[:for_role] ? params[:for_role] : []
@_message = { :error => $! }
render :new
rescue Exception => e
Chef::Log.error("Exception creating role: #{e.message}")
@available_recipes = get_available_recipes
@role = Chef::Role.new
@role.default_attributes(JSON.parse(params[:default_attributes])) if params[:default_attributes] != ''
@role.override_attributes(JSON.parse(params[:override_attributes])) if params[:override_attributes] != ''
@current_recipes = params[:for_role] ? params[:for_role] : []
@_message = { :error => "Exception raised creating role, please check logs for details" }
render :new
end
end
end
Expand Down Expand Up @@ -113,11 +123,13 @@ def update
@role.save
@_message = { :notice => "Updated Role" }
render :show
rescue ArgumentError
rescue Exception => e
Chef::Log.error("Exception updating role: #{e.message}")
@available_recipes = get_available_recipes
@current_recipes = params[:for_role] ? params[:for_role] : []
@role.default_attributes(JSON.parse(params[:default_attributes])) if params[:default_attributes] != ''
@role.override_attributes(JSON.parse(params[:override_attributes])) if params[:override_attributes] != ''
@_message = { :error => "Exception raised updating role, please check logs for details" }
render :edit
end

Expand Down
82 changes: 82 additions & 0 deletions chef-server-slice/app/views/layout/_jsonedit.html.haml
@@ -0,0 +1,82 @@
- throw_content :header_content do
= css_include_tag "jsonedit_main.css"
= js_include_tag "json.js"
= js_include_tag "yetii-min.js"
%script{:type=>"text/javascript", :src => "/javascripts/jsonedit_main.js"}

%script= "$(document).ready(function() { $$(\"jsonstr\").value = JSON.stringify(#{json}); if (BCJTEP.build()) { $$(\"results\").innerHTML = \"&nbsp;\"; $$(\"editortab\").className = \"show\"; $$(\"searchtab\").className = \"show\"; }});"
%div#jsoneditor
%div#treecontainer
%div#div1
%div#tabcontainer
%div#tab-container-1.tablayout
%ul#tab-container-1-nav.tablayout
%li#searchtab.noshow
%a{ :href => "#tab1"} search
%li#editortab.noshow
%a{ :href => "#tab2"} editor
%li#sourcetab
%a{ :href => "#tab3"} source
%div#tab1.tab
%table.icanhastable
%tr
%td
%span search :
%input#keyword{:type => "text"}
%input#search{:type => "button", :value => "Find"}
%tr
%td
%div#results &nbsp;
%div#tab2.tab
%table.icanhastable
%tr
%td
%div#add.button{:title => "Add a new attribute"}
%div#delete.button{:title => "Delete current attribute"}
%div#savedstatus{:style => "display:none;"}
%img{ :src=> "/images/jsonedit/saved.png"}
%span Saved!
%div#deletedstatus{:style => "display:none;"}
%img{ :src=> "/images/jsonedit/deleted.png"}
%span Deleted!
%td
type :
%select#jsontypes
%option Select Type
%tr
%td{:colspan => "2"}
%div#jsonnameinput
name :
%input#jsonname{:type => "text", :size=>"55", :class => ""}
%tr
%td{:colspan => "2"}
%textarea#jsonvalue{:wrap => "virtual", :cols => "55", :rows => "5", :class => ""}
%tr
%td{:colspan => "2"}
%div#jsonpath &nbsp;
%div#jsonmode &nbsp;
%tr
%td{:style => "text-align:left !important"}
%input#autodetect{:type => "checkbox", :checked=> "true"}
%label{:for => "autodetect"} Autodetect type of attribute?
%td
%input#savebutton{:type => "button", :value => "Save Attribute"}
%input#addbutton{:type => "button", :value => "Add Attribute"}
%div#tab3.tab
%div#tab-container-2.tablayout.nested
%ul#tab-container-2-nav.tablayout
%li
%a{ :href => "#tab3a" } json
%div#tab1a.tabn
%table.icanhastable
%tr
%td
%div#refresh.button{:title => "Reload JSON from Tree"}
%div#buildbutton.button{:title => "Load JSON from Source"}
%tr
%td
%textarea#jsonstr{:wrap => "virtual", :cols => "55", :rows => "10", :class => ""}
%div#console
%div#bar
%a#consolebar Error Console
%div#log
Expand Up @@ -4,13 +4,14 @@
%head
%meta{ "http-equiv" => "content-type", :content => "text/html; charset=utf-8" }
%title Chef Server
= css_include_tag "base", "themes/djime-cerulean/style", "chef", "/facebox/facebox.css", "jquery-ui-1.7.1.custom", "jquery.treeTable"
= css_include_tag "base", "themes/djime-cerulean/style", "chef", "/facebox/facebox.css", "jquery-ui-1.7.1.custom", "jquery.treeTable", "jsonedit_main.css"
= js_include_tag "jquery-1.3.2.min", "jquery.jeditable.mini", "jquery.livequery", "jquery.localscroll", "jquery.scrollTo", "jquery.tools.min"
= js_include_tag "/facebox/facebox.js"
= js_include_tag "jquery-ui-1.7.1.custom.min"
= js_include_tag "jquery.treeTable.min"
= js_include_tag "JSONeditor"
= js_include_tag "chef"
= catch_content :header_content
%body
#container
Expand Down
9 changes: 3 additions & 6 deletions chef-server-slice/app/views/nodes/_form.html.haml
Expand Up @@ -40,13 +40,10 @@
%li{ :id => "recipe[#{recipe}]", :class => 'ui-state-default' }= h recipe


%div.group.form
%div.group.form{:style => "position:relative;"}
%label.label Attributes
%div.editor
%div#tree
%div#jform
%div.clear
%script= "$(document).ready(function() { JSONeditor.start('tree', 'jform', #{@node.attribute.to_json}, false); });"
= partial '../layout/jsonedit', :json =>@node.attribute.to_json
%div.group.form
%span.description A JSON hash for default attributes for nodes of this node. These attributes will only be applied if the node does not already have a value for the attributes.

= form(:action => form_url, :method => :post, :id => form_id, :class => 'form') do
Expand Down
8 changes: 2 additions & 6 deletions chef-server-slice/app/views/roles/_form.html.haml
Expand Up @@ -34,13 +34,9 @@
Drag recipes from the list of Available Recipes section on the left, and drop them
in the "Recipes for this Role" section on the right. Then sort the recipes for this role list to the order you would like to see the recipes applied.

%div.group.form
%div.group.form{:style => "position:relative;"}
%label.label Default and Override Attributes
%div.editor
%div#tree
%div#jform
%div.clear
%script= "$(document).ready(function() { JSONeditor.start('tree', 'jform', #{ { :defaults => @role.default_attributes, :overrides => @role.override_attributes }.to_json }, false); });"
= partial '../layout/jsonedit', :json => { :defaults => @role.default_attributes, :overrides => @role.override_attributes }.to_json
%span.description A JSON hash for default attributes for nodes of this role. These attributes will only be applied if the node does not already have a value for the attributes.
= form(:action => form_url, :method => :post, :id => form_id, :class => 'form') do
%div.group
Expand Down
Binary file added chef-server-slice/public/images/jsonedit/add2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added chef-server-slice/public/images/jsonedit/bullet.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added chef-server-slice/public/images/jsonedit/cross.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added chef-server-slice/public/images/jsonedit/delete.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added chef-server-slice/public/images/jsonedit/deleted.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added chef-server-slice/public/images/jsonedit/json.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added chef-server-slice/public/images/jsonedit/label.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added chef-server-slice/public/images/jsonedit/minus.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added chef-server-slice/public/images/jsonedit/pixel.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added chef-server-slice/public/images/jsonedit/plus.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added chef-server-slice/public/images/jsonedit/saved.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added chef-server-slice/public/images/jsonedit/value.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 58352d9

Please sign in to comment.