def _validate_sleep(minutes):
 if isinstance(minutes, str):
  if (minutes.lower() in ['never', 'off']):
   return 'Never'
  else:
   msg = 'Invalid String Value for Minutes.\nString values must be "Never" or "Off".\nPassed: {0}'.format(minutes)
   raise SaltInvocationError(msg)
 elif isinstance(minutes, bool):
  if minutes:
   msg = 'Invalid Boolean Value for Minutes.\nBoolean value "On" or "True" is not allowed.\nSalt CLI converts "On" to boolean True.\nPassed: {0}'.format(minutes)
   raise SaltInvocationError(msg)
  else:
   return 'Never'
 elif isinstance(minutes, int):
  if (minutes in range(1, 181)):
   return minutes
  else:
   msg = 'Invalid Integer Value for Minutes.\nInteger values must be between 1 and 180.\nPassed: {0}'.format(minutes)
   raise SaltInvocationError(msg)
 else:
  msg = 'Unknown Variable Type Passed for Minutes.\nPassed: {0}'.format(minutes)
  raise SaltInvocationError(msg)

def _validate_sleep ( minutes ) : if isinstance ( minutes , str ) : if ( minutes . lower ( ) in [ 'never' , 'off' ] ) : return 'Never' else : msg = 'Invalid String Value for Minutes.\nString values must be "Never" or "Off".\nPassed: {0}' . format ( minutes ) raise SaltInvocationError ( msg ) elif isinstance ( minutes , bool ) : if minutes : msg = 'Invalid Boolean Value for Minutes.\nBoolean value "On" or "True" is not allowed.\nSalt CLI converts "On" to boolean True.\nPassed: {0}' . format ( minutes ) raise SaltInvocationError ( msg ) else : return 'Never' elif isinstance ( minutes , int ) : if ( minutes in range ( 1 , 181 ) ) : return minutes else : msg = 'Invalid Integer Value for Minutes.\nInteger values must be between 1 and 180.\nPassed: {0}' . format ( minutes ) raise SaltInvocationError ( msg ) else : msg = 'Unknown Variable Type Passed for Minutes.\nPassed: {0}' . format ( minutes ) raise SaltInvocationError ( msg )
helper function that validates the minutes parameter .