def invalid_kwargs(invalid_kwargs, raise_exc=True):
 if invalid_kwargs:
  if isinstance(invalid_kwargs, dict):
   new_invalid = ['{0}={1}'.format(x, y) for (x, y) in six.iteritems(invalid_kwargs)]
   invalid_kwargs = new_invalid
 msg = 'The following keyword arguments are not valid: {0}'.format(', '.join(invalid_kwargs))
 if raise_exc:
  raise SaltInvocationError(msg)
 else:
  return msg

def invalid_kwargs ( invalid_kwargs , raise_exc = True ) : if invalid_kwargs : if isinstance ( invalid_kwargs , dict ) : new_invalid = [ '{0}={1}' . format ( x , y ) for ( x , y ) in six . iteritems ( invalid_kwargs ) ] invalid_kwargs = new_invalid msg = 'The following keyword arguments are not valid: {0}' . format ( ', ' . join ( invalid_kwargs ) ) if raise_exc : raise SaltInvocationError ( msg ) else : return msg
raise a saltinvocationerror if invalid_kwargs is non-empty .