Return the current runlevel

def _runlevel():
    '''
    Return the current runlevel
    '''
    if 'upstart._runlevel' in __context__:
        return __context__['upstart._runlevel']
    ret = _default_runlevel()
    utmp = _find_utmp()
    if utmp:
        out = __salt__['cmd.run'](['runlevel', '{0}'.format(utmp)], python_shell=False)
        try:
            ret = out.split()[1]
        except IndexError:
            pass
    __context__['upstart._runlevel'] = ret
    return ret