<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -25,7 +25,6 @@ class ChefServerApi::Cookbooks &lt; ChefServerApi::Application
   provides :json
 
   before :authenticate_every
-  before :is_admin
 
   include Chef::Mixin::Checksum
   </diff>
      <filename>chef-server-api/app/controllers/cookbooks.rb</filename>
    </modified>
    <modified>
      <diff>@@ -25,7 +25,7 @@ class ChefServerApi::Nodes &lt; ChefServerApi::Application
   
   before :authenticate_every 
   before :fix_up_node_id
-  before :is_correct_node, :only =&gt; [ :create, :update, :destroy, :cookbooks ]
+  before :is_correct_node, :only =&gt; [ :update, :destroy, :cookbooks ]
   
   def index
     @node_list = Chef::Node.cdb_list </diff>
      <filename>chef-server-api/app/controllers/nodes.rb</filename>
    </modified>
    <modified>
      <diff>@@ -65,24 +65,26 @@ if defined?(Merb::Plugins)
         end
         Chef::Nanite.in_event { Chef::Log.info(&quot;Nanite is ready&quot;) }
 
-        # create the couch design docs for nodes, roles, and databags
-        Chef::CouchDB.new.create_id_map
-        Chef::Node.create_design_document
-        Chef::Role.create_design_document
-        Chef::DataBag.create_design_document
-        Chef::ApiClient.create_design_document
+        unless Merb::Config.environment == &quot;test&quot;
+          # create the couch design docs for nodes, roles, and databags
+          Chef::CouchDB.new.create_id_map
+          Chef::Node.create_design_document
+          Chef::Role.create_design_document
+          Chef::DataBag.create_design_document
+          Chef::ApiClient.create_design_document
 
-        Chef::Log.info('Loading roles')
-        Chef::Role.sync_from_disk_to_couchdb
+          Chef::Log.info('Loading roles')
+          Chef::Role.sync_from_disk_to_couchdb
 
-        # Create the signing key and certificate 
-        Chef::Certificate.generate_signing_ca
+          # Create the signing key and certificate 
+          Chef::Certificate.generate_signing_ca
 
-        # Generate the validation key
-        Chef::Certificate.gen_validation_key
+          # Generate the validation key
+          Chef::Certificate.gen_validation_key
 
-        # Generate the Web UI Key 
-        Chef::Certificate.gen_validation_key(Chef::Config[:web_ui_client_name], Chef::Config[:web_ui_key])
+          # Generate the Web UI Key 
+          Chef::Certificate.gen_validation_key(Chef::Config[:web_ui_client_name], Chef::Config[:web_ui_key])
+        end
       end
     end
 </diff>
      <filename>chef-server-api/lib/chef-server-api.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,8 +4,10 @@ require 'chef'
 
 Chef::Config.from_file(File.join(&quot;/etc&quot;, &quot;chef&quot;, &quot;server.rb&quot;))
 
-Merb::Config.setup(:merb_root   =&gt; File.expand_path(File.dirname(__FILE__)),
-                   :environment =&gt; ENV['RACK_ENV'], :init_file =&gt; File.dirname(__FILE__) / &quot;config/init.rb&quot;)
+Merb::Config.setup(:merb_root   =&gt; File.expand_path(File.dirname(__FILE__)), 
+                   :environment =&gt; ENV['RACK_ENV'], 
+                   :fork_for_class_load =&gt; false,
+                   :init_file =&gt; File.dirname(__FILE__) / &quot;config/init.rb&quot;)
 Merb.environment = Merb::Config[:environment]
 Merb.root = Merb::Config[:merb_root]
 Merb::BootLoader.run</diff>
      <filename>chef-server/config.ru</filename>
    </modified>
    <modified>
      <diff>@@ -4,11 +4,7 @@ require 'rake/rdoctask'
 require './tasks/rspec.rb'
 
 GEM = &quot;chef&quot;
-&lt;&lt;&lt;&lt;&lt;&lt;&lt; HEAD:chef/Rakefile
 CHEF_VERSION = &quot;0.8.0&quot;
-=======
-CHEF_VERSION = &quot;0.7.12&quot;
-&gt;&gt;&gt;&gt;&gt;&gt;&gt; 6f78b9ff0026b1784375a8baf8076c0cc210c946:chef/Rakefile
 AUTHOR = &quot;Adam Jacob&quot;
 EMAIL = &quot;adam@opscode.com&quot;
 HOMEPAGE = &quot;http://wiki.opscode.com/display/chef&quot;
@@ -27,14 +23,7 @@ spec = Gem::Specification.new do |s|
   s.homepage = HOMEPAGE
   
   s.add_dependency &quot;mixlib-config&quot;, &quot;&gt;= 1.0.12&quot;
-&lt;&lt;&lt;&lt;&lt;&lt;&lt; HEAD:chef/Rakefile
   %w{mixlib-cli mixlib-log mixlib-authentication json erubis extlib ohai amqp thor ruby-hmac}.each { |gem| s.add_dependency gem }
-=======
-  s.add_dependency &quot;ohai&quot;, &quot;&gt;= 0.3.4&quot;
-  %w{mixlib-cli mixlib-log ruby-openid
-    json erubis extlib
-    stomp}.each { |gem| s.add_dependency gem }
-&gt;&gt;&gt;&gt;&gt;&gt;&gt; 6f78b9ff0026b1784375a8baf8076c0cc210c946:chef/Rakefile
   
   s.bindir       = &quot;bin&quot;
   s.executables  = %w( chef-client chef-solo knife )</diff>
      <filename>chef/Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -283,21 +283,6 @@ class Chef
       @run_list.detect { |r| r == item } ? true : false
     end
     
-    # Set an attribute based on the missing method.  If you pass an argument, we'll use that
-    # to set the attribute values.  Otherwise, we'll wind up just returning the attributes
-    # value.
-    def method_missing(symbol, *args)
-      if args.length != 0
-        @attribute[symbol] = args.length == 1 ? args[0] : args
-      else
-        if @attribute.has_key?(symbol)
-          @attribute[symbol]
-        else
-          raise ArgumentError, &quot;Attribute #{symbol.to_s} is not defined!&quot;
-        end
-      end
-    end
- 
     # Transform the node to a Hash
     def to_hash
       index_hash = @attribute</diff>
      <filename>chef/lib/chef/node.rb</filename>
    </modified>
    <modified>
      <diff>@@ -111,8 +111,8 @@ class Chef
       self
     end
 
-    def expand(from='server', couchdb=nil)
-      couchdb = couchdb ? couchdb : Chef::CouchDB.new
+    def expand(from='server')
+      couchdb = Chef::CouchDB.new
       recipes = Array.new
       default_attrs = Mash.new
       override_attrs = Mash.new
@@ -133,13 +133,17 @@ class Chef
             role = r.get_rest(&quot;roles/#{name}&quot;)
           elsif from == 'couchdb'
             # Load the role from couchdb
-            role = Chef::Role.cdb_load(name, couchdb)
+            role = Chef::Role.cdb_load(name)
           end
           role.recipes.each { |r| recipes &lt;&lt;  r unless recipes.include?(r) }
           default_attrs = Chef::Mixin::DeepMerge.merge(default_attrs, role.default_attributes)
           override_attrs = Chef::Mixin::DeepMerge.merge(override_attrs, role.override_attributes)
         end
       end
+      Chef::Log.error(&quot;****\n\n\n&quot;)
+      Chef::Log.error(default_attrs)
+      Chef::Log.error(override_attrs)
+      Chef::Log.error(&quot;****\n\n\n&quot;)
       return recipes, default_attrs, override_attrs
     end
 </diff>
      <filename>chef/lib/chef/run_list.rb</filename>
    </modified>
    <modified>
      <diff>@@ -111,7 +111,7 @@ class Chef
             run_action(resource, ra)
           end
         rescue =&gt; e
-          Chef::Log.error(&quot;#{resource} (#{resource.source_line}) had an error:\n#{e}\n#{e.backtrace}&quot;)
+          Chef::Log.error(&quot;#{resource} (#{resource.source_line}) had an error:\n#{e}\n#{e.backtrace.join(&quot;\n&quot;)}&quot;)
           raise e unless resource.ignore_failure
         end
       end</diff>
      <filename>chef/lib/chef/runner.rb</filename>
    </modified>
    <modified>
      <diff>@@ -327,7 +327,8 @@ describe Chef::Node do
 
       it &quot;should create if it cannot update&quot; do
         @node.name(&quot;monkey&quot;)
-        @rest.should_receive(:put_rest).and_raise(Net::HTTPServerException.new(1, 3))
+        exception = mock(&quot;404 error&quot;, :code =&gt; &quot;404&quot;)
+        @rest.should_receive(:put_rest).and_raise(Net::HTTPServerException.new(&quot;foo&quot;, exception))
         @rest.should_receive(:post_rest).with(&quot;nodes&quot;, @node)
         @node.save
       end</diff>
      <filename>chef/spec/unit/node_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -129,7 +129,7 @@ describe Chef::Provider::Git do
                       &quot;b7d19519a1c15f1c1a324e2683bd728b6198ce5a\trefs/tags/0.7.8^{}\n&quot;+
                       &quot;ebc1b392fe7e8f0fbabc305c299b4d365d2b4d9b\trefs/tags/chef-server-package&quot;
       @resource.revision ''
-      @stdout.stub(:string).and_return(lots_of_shas)
+      @stdout.stub!(:string).and_return(lots_of_shas)
       @provider.should_receive(:popen4).and_yield(&quot;pid&quot;,&quot;stdin&quot;,@stdout,@stderr).and_return(@exitstatus)
       @provider.revision_sha.should eql(&quot;28af684d8460ba4793eda3e7ac238c864a5d029a&quot;)
     end
@@ -231,4 +231,4 @@ describe Chef::Provider::Git do
     @provider.action_export
   end
   
-end
\ No newline at end of file
+end</diff>
      <filename>chef/spec/unit/provider/git_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -147,7 +147,7 @@ describe Chef::RunList do
 
       Chef::Role.stub!(:from_disk).and_return(@role)
       Chef::Role.stub!(:load).and_return(@role)
-      @rest = mock(&quot;Chef::REST&quot;, { :get_rest =&gt; @role })
+      @rest = mock(&quot;Chef::REST&quot;, { :get_rest =&gt; @role, :url =&gt; &quot;/&quot; })
       Chef::REST.stub!(:new).and_return(@rest)
       
       @run_list &lt;&lt; &quot;role[stubby]&quot;
@@ -175,7 +175,7 @@ describe Chef::RunList do
 
     describe &quot;from couchdb&quot; do
       it &quot;should load the role from couchdb&quot; do
-        Chef::Role.should_receive(:load)
+        Chef::Role.should_receive(:cdb_load).and_return(@role)
         @run_list.expand(&quot;couchdb&quot;)
       end
     end</diff>
      <filename>chef/spec/unit/run_list_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -8,7 +8,7 @@ Feature: List clients via the REST API
     Given a 'registration' named 'bobo' exists
       And there are no clients 
      When I 'GET' the path '/clients' 
-     Then the inflated response should be '2' items long 
+     Then the inflated response should be '3' items long 
 
   Scenario: List clients when one has been created
     Given a 'registration' named 'bobo' exists</diff>
      <filename>features/api/clients/list_clients_api.feature</filename>
    </modified>
    <modified>
      <diff>@@ -17,8 +17,4 @@ Feature: List cookbooks via the REST API
      When I 'GET' the path '/cookbooks' using a wrong private key
      Then I should get a '401 &quot;Unauthorized&quot;' exception
 
-  Scenario: List cookbooks when I am not an admin
-    Given a 'registration' named 'not_admin' exists
-     When I 'GET' the path '/cookbooks'
-     Then I should get a '401 &quot;Unauthorized&quot;' exception
 </diff>
      <filename>features/api/cookbooks/list_cookbooks_api.feature</filename>
    </modified>
    <modified>
      <diff>@@ -26,8 +26,4 @@ Feature: Show a cookbook via the REST API
      When I 'GET' the path '/cookbooks/show_cookbook' using a wrong private key
      Then I should get a '401 &quot;Unauthorized&quot;' exception
 
-  Scenario: Show a cookbook with as a non-administrator  
-    Given a 'registration' named 'not_admin' exists
-     When I 'GET' the path '/cookbooks/show_cookbook'
-     Then I should get a '401 &quot;Unauthorized&quot;' exception
 </diff>
      <filename>features/api/cookbooks/show_cookbook_api.feature</filename>
    </modified>
    <modified>
      <diff>@@ -19,8 +19,3 @@ Feature: Show a cookbooks attribute files via the REST API
       When I 'GET' the path '/cookbooks/show_cookbook/attributes' using a wrong private key
       Then I should get a '401 &quot;Unauthorized&quot;' exception
 
-  Scenario: Show a cookbooks attribute files as a non-admin
-    Given a 'registration' named 'not_admin' exists
-     When I 'GET' the path '/cookbooks/show_cookbook/attributes'
-     Then I should get a '401 &quot;Unauthorized&quot;' exception
-</diff>
      <filename>features/api/cookbooks/show_cookbook_attributes_api.feature</filename>
    </modified>
    <modified>
      <diff>@@ -23,9 +23,3 @@ Feature: Create a node via the REST API
      When I 'POST' the 'node' to the path '/nodes' using a wrong private key
      Then I should get a '401 &quot;Unauthorized&quot;' exception
 
-  Scenario: Create a new node as when I am not an admin
-    Given a 'registration' named 'not_admin' exists
-      And a 'node' named 'webserver'
-     When I 'POST' the 'node' to the path '/nodes' 
-     Then I should get a '401 &quot;Unauthorized&quot;' exception
-     </diff>
      <filename>features/api/nodes/create_node_api.feature</filename>
    </modified>
    <modified>
      <diff>@@ -14,4 +14,4 @@
     &quot;ossining&quot;: &quot;whatever&quot;,
     &quot;snakes&quot;: &quot;on a plane&quot;
   }
-}
\ No newline at end of file
+}</diff>
      <filename>features/data/roles/role_test.json</filename>
    </modified>
    <modified>
      <diff>@@ -56,7 +56,7 @@ When /^I run the chef\-client for '(.+)' seconds$/ do |run_for|
 end
 
 When /^I run the chef\-client at log level '(.+)'$/ do |log_level|
-  @log_level = log_level
+  @log_level = log_level.to_sym
   When &quot;I run the chef-client&quot;
 end
 
@@ -76,11 +76,17 @@ log_location     File.join(tmpdir, &quot;silly-monkey.log&quot;)
 file_cache_path  File.join(tmpdir, &quot;cache&quot;)
 ssl_verify_mode  :verify_none
 registration_url &quot;http://127.0.0.1:4000&quot;
-openid_url       &quot;http://127.0.0.1:4001&quot;
+openid_url       &quot;http://127.0.0.1:4000&quot;
 template_url     &quot;http://127.0.0.1:4000&quot;
 remotefile_url   &quot;http://127.0.0.1:4000&quot;
 search_url       &quot;http://127.0.0.1:4000&quot;
-couchdb_database   'chef'
+role_url         &quot;http://127.0.0.1:4000&quot;
+client_url       &quot;http://127.0.0.1:4000&quot;
+chef_server_url  &quot;http://127.0.0.1:4000&quot;
+validation_client_name &quot;validator&quot;
+systmpdir = File.expand_path(File.join(Dir.tmpdir, &quot;chef_integration&quot;))
+validation_key   File.join(systmpdir, &quot;validation.pem&quot;)
+client_key       File.join(systmpdir, &quot;client.pem&quot;)
 CONFIG
   
   @config_file = File.expand_path(File.join(File.dirname(__FILE__), '..', 'data', 'config', 'client-with-logging.rb'))  
@@ -91,7 +97,7 @@ CONFIG
   self.cleanup_files &lt;&lt; @config_file
   
   
-  @status = Chef::Mixin::Command.popen4(&quot;#{File.join(File.dirname(__FILE__), &quot;..&quot;, &quot;..&quot;, &quot;chef&quot;, &quot;bin&quot;, &quot;chef-client&quot;)} -l #{@log_level} -c #{@config_file} #{@chef_args}&quot;) do |p, i, o, e|
+  @status = Chef::Mixin::Command.popen4(&quot;#{File.join(File.dirname(__FILE__), &quot;..&quot;, &quot;..&quot;, &quot;chef&quot;, &quot;bin&quot;, &quot;chef-client&quot;)} -c #{@config_file} #{@chef_args}&quot;) do |p, i, o, e|
     @stdout = o.gets(nil)
     @stderr = e.gets(nil)
   end</diff>
      <filename>features/steps/run_client_steps.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,3 @@
-#
-# Author:: Adam Jacob (&lt;adam@opscode.com&gt;)
 # Copyright:: Copyright (c) 2008 Opscode, Inc.
 # License:: Apache License, Version 2.0
 #
@@ -88,6 +86,7 @@ def create_databases
   Chef::Certificate.gen_validation_key
   Chef::Certificate.gen_validation_key(Chef::Config[:web_ui_client_name], Chef::Config[:web_ui_key])
   system(&quot;cp #{File.join(Dir.tmpdir, &quot;chef_integration&quot;, &quot;validation.pem&quot;)} #{Dir.tmpdir}&quot;)
+  system(&quot;cp #{File.join(Dir.tmpdir, &quot;chef_integration&quot;, &quot;webui.pem&quot;)} #{Dir.tmpdir}&quot;)
 end
 
 def prepare_replicas
@@ -101,8 +100,19 @@ def cleanup
   if File.exists?(Chef::Config[:validation_key])
     File.unlink(Chef::Config[:validation_key])
   end
+  if File.exists?(Chef::Config[:web_ui_key])
+    File.unlink(Chef::Config[:web_ui_key])
+  end
 end
 
+Merb.start_environment(
+  :merb_root =&gt; File.join(File.dirname(__FILE__), &quot;..&quot;, &quot;..&quot;, &quot;chef-server&quot;), 
+  :testing =&gt; true, 
+  :adapter =&gt; 'runner',
+  :environment =&gt; ENV['MERB_ENV'] || 'test',
+  :session_store =&gt; 'memory'
+)
+
 ###
 # Pre-testing setup
 ###
@@ -113,14 +123,6 @@ delete_databases
 create_databases
 prepare_replicas
 
-Merb.start_environment(
-  :merb_root =&gt; File.join(File.dirname(__FILE__), &quot;..&quot;, &quot;..&quot;, &quot;chef-server&quot;), 
-  :testing =&gt; true, 
-  :adapter =&gt; 'runner',
-  :environment =&gt; ENV['MERB_ENV'] || 'test',
-  :session_store =&gt; 'memory'
-)
-
 Spec::Runner.configure do |config|
   config.include(Merb::Test::ViewHelper)
   config.include(Merb::Test::RouteHelper)
@@ -171,6 +173,7 @@ World(ChefWorld)
 Before do
   system(&quot;mkdir -p #{tmpdir}&quot;)
   system(&quot;cp -r #{File.join(Dir.tmpdir, &quot;validation.pem&quot;)} #{File.join(tmpdir, &quot;validation.pem&quot;)}&quot;)
+  system(&quot;cp -r #{File.join(Dir.tmpdir, &quot;webui.pem&quot;)} #{File.join(tmpdir, &quot;webui.pem&quot;)}&quot;)
   Chef::CouchDB.new(Chef::Config[:couchdb_url], &quot;chef_integration&quot;).create_db
   c = Chef::REST.new(Chef::Config[:couchdb_url], nil, nil)
   c.post_rest(&quot;_replicate&quot;, { </diff>
      <filename>features/support/env.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>19db05a58855537bef42f660907a5e788b7855a3</id>
    </parent>
  </parents>
  <author>
    <name>Adam Jacob</name>
    <email>adam@opscode.com</email>
  </author>
  <url>http://github.com/opscode/chef/commit/2f85186fcc8979c089e44104eb463625ba362d27</url>
  <id>2f85186fcc8979c089e44104eb463625ba362d27</id>
  <committed-date>2009-10-19T22:54:06-07:00</committed-date>
  <authored-date>2009-10-19T22:54:06-07:00</authored-date>
  <message>Fixes for 0.7.12-&gt;0.8 merge, tests pass</message>
  <tree>853c4e88663c01ce9e593af1915d36501fdebaec</tree>
  <committer>
    <name>Adam Jacob</name>
    <email>adam@opscode.com</email>
  </committer>
</commit>
