def validate_start_action(action):
 valid_actions = ['start', 'restart']
 if (action.lower() not in valid_actions):
  raise UnknownAction(action)

def validate_start_action ( action ) : valid_actions = [ 'start' , 'restart' ] if ( action . lower ( ) not in valid_actions ) : raise UnknownAction ( action )
validates if the action given is a valid one - currently only start and restart are supported .