def _configure(changes):
 cfgred = True
 reasons = []
 fun = 'update_config'
 for key in ['added', 'updated', 'removed']:
  _updated_changes = changes.get(key, {})
  if (not _updated_changes):
   continue
  _location = _updated_changes.get('location', '')
  _contact = _updated_changes.get('contact', '')
  _community = _updated_changes.get('community', {})
  _chassis_id = _updated_changes.get('chassis_id', '')
  if (key == 'removed'):
   fun = 'remove_config'
  _ret = __salt__['snmp.{fun}'.format(fun=fun)](location=_location, contact=_contact, community=_community, chassis_id=_chassis_id, commit=False)
  cfgred = (cfgred and _ret.get('result'))
  if ((not _ret.get('result')) and _ret.get('comment')):
   reasons.append(_ret.get('comment'))
 return {'result': cfgred, 'comment': ('\n'.join(reasons) if reasons else '')}

def _configure ( changes ) : cfgred = True reasons = [ ] fun = 'update_config' for key in [ 'added' , 'updated' , 'removed' ] : _updated_changes = changes . get ( key , { } ) if ( not _updated_changes ) : continue _location = _updated_changes . get ( 'location' , '' ) _contact = _updated_changes . get ( 'contact' , '' ) _community = _updated_changes . get ( 'community' , { } ) _chassis_id = _updated_changes . get ( 'chassis_id' , '' ) if ( key == 'removed' ) : fun = 'remove_config' _ret = __salt__ [ 'snmp.{fun}' . format ( fun = fun ) ] ( location = _location , contact = _contact , community = _community , chassis_id = _chassis_id , commit = False ) cfgred = ( cfgred and _ret . get ( 'result' ) ) if ( ( not _ret . get ( 'result' ) ) and _ret . get ( 'comment' ) ) : reasons . append ( _ret . get ( 'comment' ) ) return { 'result' : cfgred , 'comment' : ( '\n' . join ( reasons ) if reasons else '' ) }
amend the global configuration object with command line options .