files/aerobase-cookbooks/aerobase/libraries/unifiedpush.rb
def parse_contactpoints_settings
      # If the user wants to run the in symetric cluster mode,
      # then those settings should also be applied to  aerobase-server.
      [
        # %w{aerobase_server server_contactpoints} corresponds to
        # Unifiedpush['aerobase_server']['server_contactpoints'], etc.
        [%w{aerobase_server server_contactpoints}, %w{global contactpoints}],
      ].each do |left, right|
        if ! Unifiedpush[left.first][left.last].nil?
          # If the user explicitly sets a value for e.g.
          # unifiedpush['db_port'] in unifiedpush.rb then we should never override
          # that.
          next
        end

        better_value_from_unifiedpush_rb = Unifiedpush[right.first][right.last]
        default_from_attributes = node['unifiedpush'][right.first.gsub('_', '-')][right.last]
        Unifiedpush[left.first][left.last] = better_value_from_unifiedpush_rb || default_from_attributes
      end
    end
# guards against creating secrets on non-bootstrap node
guards against creating secrets on non-bootstrap node
guards against creating secrets on non - bootstrap node
def parse_contactpoints_settings
      [
        [%w{aerobase_server server_contactpoints}, %w{global contactpoints}],
      ].each do |left, right|
        if ! Unifiedpush[left.first][left.last].nil?
          next
        end
        better_value_from_unifiedpush_rb = Unifiedpush[right.first][right.last]
        default_from_attributes = node['unifiedpush'][right.first.gsub('_', '-')][right.last]
        Unifiedpush[left.first][left.last] = better_value_from_unifiedpush_rb || default_from_attributes
      end
    end
def parse_contactpoints_settings [ [ %w{ aerobase_server server_contactpoints } , %w{ global contactpoints } ] , ] . each do | left , right | if ! Unifiedpush [ left . first ] [ left . last ] . nil? next end better_value_from_unifiedpush_rb = Unifiedpush [ right . first ] [ right . last ] default_from_attributes = node [ 'unifiedpush' ] [ right . first . gsub ( '_' , '-' ) ] [ right . last ] Unifiedpush [ left . first ] [ left . last ] = better_value_from_unifiedpush_rb || default_from_attributes end end
guards against creating secrets on non-bootstrap node
guards against creating secrets on non - bootstrap node
# If the user wants to run the in symetric cluster mode, # then those settings should also be applied to  aerobase-server. # %w{aerobase_server server_contactpoints} corresponds to # Unifiedpush['aerobase_server']['server_contactpoints'], etc. # If the user explicitly sets a value for e.g. # unifiedpush['db_port'] in unifiedpush.rb then we should never override # that.