@@ -420,11 +420,12 @@ def self.size_to_bytes(s)
420420 class DependsOn
421421 class << self
422422 def add ( dependency )
423- @recipe_depedancies ||= Mash . new
424- @recipe_depedancies . merge! ( dependency )
423+ @recipe_depedencies ||= Mash . new
424+ @recipe_depedencies . merge! ( dependency )
425425 end
426+
426427 def get ( recipe )
427- @recipe_depedancies . fetch ( recipe , [ ] )
428+ @recipe_depedencies . fetch ( recipe , [ ] )
428429 end
429430 end
430431 end
@@ -440,28 +441,26 @@ def last_two_configs(group, barclamp, instance)
440441 end
441442
442443 def loadattr ( hash , attrlist )
443- i = 0
444+ i = 0
445+ return hash unless attlist . length > 0
444446 while hash . is_a? ( Hash )
445- if hash . key? ( attrlist [ i ] )
446- hash = hash [ attrlist [ i ] ]
447- Chef ::Log . debug ( "smart loadattr #{ attrlist [ i ] } , #{ hash } " )
448- i +=1
449- return hash if attrlist . length == i
450- else
451- return nil
452- end
447+ return nil unless hash . key? ( attrlist [ i ] )
448+ hash = hash [ attrlist [ i ] ]
449+ Chef ::Log . debug ( "smart loadattr #{ attrlist [ i ] } , #{ hash } " )
450+ i += 1
451+ return hash if attrlist . length == i
453452 end
454453 end
455454
456- def has_changes_to_apply ( depedency , group = "openstack" , instance = nil )
455+ def changes_to_apply? ( depedency , group = "openstack" , instance = nil )
457456 barclamp = depedency . shift
458457 prev_cfg , curr_cfg = Barclamp ::Config . last_two_configs ( group , barclamp , instance )
459458 old = loadattr ( prev_cfg , depedency )
460459 new = loadattr ( curr_cfg , depedency )
461460 Chef ::Log . debug ( "smart loadattr prev #{ depedency } , #{ prev_cfg } " )
462461 Chef ::Log . debug ( "smart loadattr curr #{ depedency } , #{ curr_cfg . inspect } " )
463462 Chef ::Log . debug ( "smart comparisoin #{ old } , #{ new } " )
464- return old != new
463+ old != new
465464 end
466465
467466 def load ( group , barclamp , instance = nil )
0 commit comments