Browse files

`default_attributes` and `override_attributes` no longer required in …

…roles.
  • Loading branch information...
1 parent 9bc4496 commit 0ab3c4ce6de1c6996898ee15096b70df9c3fcbe3 @winhamwr winhamwr committed Oct 29, 2012
Showing with 10 additions and 3 deletions.
  1. +7 −0 CHANGELOG
  2. +3 −3 littlechef/chef.py
View
7 CHANGELOG
@@ -2,6 +2,13 @@
LittleChef Changelog
====================
+Version 1.?
+-----------
+
+Bugs fixed:
+* `default_attributes` and `override_attributes` are no longer required in
+ JSON role definitions.
+
Version 1.3.0 October 26, 2012
----------------------------------------
New features:
View
6 littlechef/chef.py
@@ -20,7 +20,7 @@
import simplejson as json
from fabric.api import *
-from fabric.contrib.files import append, exists
+from fabric.contrib.files import exists
from fabric import colors
from fabric.utils import abort
from fabric.contrib.project import rsync_project
@@ -211,7 +211,7 @@ def _add_merged_attributes(node, all_recipes, all_roles):
for role in node['roles']:
for r in all_roles:
if role == r['name']:
- update_dct(attributes, r['default_attributes'])
+ update_dct(attributes, r.get('default_attributes', {}))
# Get normal node attributes
non_attribute_fields = [
@@ -227,7 +227,7 @@ def _add_merged_attributes(node, all_recipes, all_roles):
for role in node['roles']:
for r in all_roles:
if role == r['name']:
- update_dct(attributes, r['override_attributes'])
+ update_dct(attributes, r.get('override_attributes', {}))
# Merge back to the original node object
node.update(attributes)

0 comments on commit 0ab3c4c

Please sign in to comment.