Look into the running data to check the status of all requisite
        states

def check_requisite(self, low, running, chunks, pre=False):
        '''
        Look into the running data to check the status of all requisite
        states
        '''
        disabled_reqs = self.opts.get('disabled_requisites', [])
        if not isinstance(disabled_reqs, list):
            disabled_reqs = [disabled_reqs]
        present = False
        # If mod_watch is not available make it a require
        if 'watch' in low:
            if '{0}.mod_watch'.format(low['state']) not in self.states:
                if 'require' in low:
                    low['require'].extend(low.pop('watch'))
                else:
                    low['require'] = low.pop('watch')
            else:
                present = True
        if 'watch_any' in low:
            if '{0}.mod_watch'.format(low['state']) not in self.states:
                if 'require_any' in low:
                    low['require_any'].extend(low.pop('watch_any'))
                else:
                    low['require_any'] = low.pop('watch_any')
            else:
                present = True
        if 'require' in low:
            present = True
        if 'require_any' in low:
            present = True
        if 'prerequired' in low:
            present = True
        if 'prereq' in low:
            present = True
        if 'onfail' in low:
            present = True
        if 'onfail_any' in low:
            present = True
        if 'onfail_all' in low:
            present = True
        if 'onchanges' in low:
            present = True
        if 'onchanges_any' in low:
            present = True
        if not present:
            return 'met', ()
        self.reconcile_procs(running)
        reqs = {
                'require': [],
                'require_any': [],
                'watch': [],
                'watch_any': [],
                'prereq': [],
                'onfail': [],
                'onfail_any': [],
                'onfail_all': [],
                'onchanges': [],
                'onchanges_any': []}
        if pre:
            reqs['prerequired'] = []
        for r_state in reqs:
            if r_state in low and low[r_state] is not None:
                if r_state in disabled_reqs:
                    log.warning('The %s requisite has been disabled, Ignoring.', r_state)
                    continue
                for req in low[r_state]:
                    if isinstance(req, six.string_types):
                        req = {'id': req}
                    req = trim_req(req)
                    found = False
                    for chunk in chunks:
                        req_key = next(iter(req))
                        req_val = req[req_key]
                        if req_val is None:
                            continue
                        if req_key == 'sls':
                            # Allow requisite tracking of entire sls files
                            if fnmatch.fnmatch(chunk['__sls__'], req_val):
                                found = True
                                reqs[r_state].append(chunk)
                            continue
                        try:
                            if isinstance(req_val, six.string_types):
                                if (fnmatch.fnmatch(chunk['name'], req_val) or
                                    fnmatch.fnmatch(chunk['__id__'], req_val)):
                                    if req_key == 'id' or chunk['state'] == req_key:
                                        found = True
                                        reqs[r_state].append(chunk)
                            else:
                                raise KeyError
                        except KeyError as exc:
                            raise SaltRenderError(
                                'Could not locate requisite of [{0}] present in state with name [{1}]'.format(
                                    req_key, chunk['name']))
                        except TypeError:
                            # On Python 2, the above req_val, being an OrderedDict, will raise a KeyError,
                            # however on Python 3 it will raise a TypeError
                            # This was found when running tests.unit.test_state.StateCompilerTestCase.test_render_error_on_invalid_requisite
                            raise SaltRenderError(
                                'Could not locate requisite of [{0}] present in state with name [{1}]'.format(
                                    req_key, chunk['name']))
                    if not found:
                        return 'unmet', ()
        fun_stats = set()
        for r_state, chunks in six.iteritems(reqs):
            req_stats = set()
            if r_state.startswith('prereq') and not r_state.startswith('prerequired'):
                run_dict = self.pre
            else:
                run_dict = running

            while True:
                if self.reconcile_procs(run_dict):
                    break
                time.sleep(0.01)

            for chunk in chunks:
                tag = _gen_tag(chunk)
                if tag not in run_dict:
                    req_stats.add('unmet')
                    continue
                if r_state.startswith('onfail'):
                    if run_dict[tag]['result'] is True:
                        req_stats.add('onfail')  # At least one state is OK
                        continue
                else:
                    if run_dict[tag]['result'] is False:
                        req_stats.add('fail')
                        continue
                if r_state.startswith('onchanges'):
                    if not run_dict[tag]['changes']:
                        req_stats.add('onchanges')
                    else:
                        req_stats.add('onchangesmet')
                    continue
                if r_state.startswith('watch') and run_dict[tag]['changes']:
                    req_stats.add('change')
                    continue
                if r_state.startswith('prereq') and run_dict[tag]['result'] is None:
                    if not r_state.startswith('prerequired'):
                        req_stats.add('premet')
                if r_state.startswith('prereq') and not run_dict[tag]['result'] is None:
                    if not r_state.startswith('prerequired'):
                        req_stats.add('pre')
                else:
                    if run_dict[tag].get('__state_ran__', True):
                        req_stats.add('met')
            if r_state.endswith('_any') or r_state == 'onfail':
                if 'met' in req_stats or 'change' in req_stats:
                    if 'fail' in req_stats:
                        req_stats.remove('fail')
                if 'onchangesmet' in req_stats:
                    if 'onchanges' in req_stats:
                        req_stats.remove('onchanges')
                    if 'fail' in req_stats:
                        req_stats.remove('fail')
                if 'onfail' in req_stats:
                    # a met requisite in this case implies a success
                    if 'met' in req_stats:
                        req_stats.remove('onfail')
            if r_state.endswith('_all'):
                if 'onfail' in req_stats:
                    # a met requisite in this case implies a failure
                    if 'met' in req_stats:
                        req_stats.remove('met')
            fun_stats.update(req_stats)

        if 'unmet' in fun_stats:
            status = 'unmet'
        elif 'fail' in fun_stats:
            status = 'fail'
        elif 'pre' in fun_stats:
            if 'premet' in fun_stats:
                status = 'met'
            else:
                status = 'pre'
        elif 'onfail' in fun_stats and 'onchangesmet' not in fun_stats:
            status = 'onfail'
        elif 'onchanges' in fun_stats and 'onchangesmet' not in fun_stats:
            status = 'onchanges'
        elif 'change' in fun_stats:
            status = 'change'
        else:
            status = 'met'

        return status, reqs