def _ensure_pinned_rows(dashboard):
 pinned_row_titles = __salt__['pillar.get'](_PINNED_ROWS_PILLAR)
 if (not pinned_row_titles):
  return
 pinned_row_titles_lower = []
 for title in pinned_row_titles:
  pinned_row_titles_lower.append(title.lower())
 rows = dashboard.get('rows', [])
 pinned_rows = []
 for (i, row) in enumerate(rows):
  if (row.get('title', '').lower() in pinned_row_titles_lower):
   del rows[i]
   pinned_rows.append(row)
 rows = (pinned_rows + rows)

def _ensure_pinned_rows ( dashboard ) : pinned_row_titles = __salt__ [ 'pillar.get' ] ( _PINNED_ROWS_PILLAR ) if ( not pinned_row_titles ) : return pinned_row_titles_lower = [ ] for title in pinned_row_titles : pinned_row_titles_lower . append ( title . lower ( ) ) rows = dashboard . get ( 'rows' , [ ] ) pinned_rows = [ ] for ( i , row ) in enumerate ( rows ) : if ( row . get ( 'title' , '' ) . lower ( ) in pinned_row_titles_lower ) : del rows [ i ] pinned_rows . append ( row ) rows = ( pinned_rows + rows )
pin rows to the top of the dashboard .