def undeployed(name,
                 url='http://localhost:8080/manager',
                 timeout=180):

    # Prepare
    ret = {'name': name,
       'result': True,
       'changes': {},
       'comment': ''}

    if not __salt__['tomcat.status'](url, timeout):
        ret['comment'] = 'Tomcat Manager does not response'
        ret['result'] = False
        return ret

    try:
        version = __salt__['tomcat.ls'](url, timeout)[name]['version']
        ret['changes'] = {'undeploy': version}
    except KeyError:
        return ret

    # Test
    if __opts__['test']:
        ret['result'] = None
        return ret

    undeploy = __salt__['tomcat.undeploy'](name, url, timeout=timeout)
    if undeploy.startswith('FAIL'):
        ret['result'] = False
        ret['comment'] = undeploy
        return ret

    return ret
Transform a datetime value to an object compatible with what is expected
dataset/ETHPy150Open saltstack/salt/salt/states/tomcat.py/undeployed--crossover with--dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.4/django/db/backends/__init__.py/BaseDatabaseOperations.value_to_db_datetime