Return a tree object for the specified environment

def get_tree(self, tgt_env):
        '''
        Return a tree object for the specified environment
        '''
        if not self.env_is_exposed(tgt_env):
            return None

        tgt_ref = self.ref(tgt_env)
        if tgt_ref is None:
            return None

        for ref_type in self.ref_types:
            try:
                func_name = 'get_tree_from_{0}'.format(ref_type)
                func = getattr(self, func_name)
            except AttributeError:
                log.error(
                    '%s class is missing function \'%s\'',
                    self.__class__.__name__, func_name
                )
            else:
                candidate = func(tgt_ref)
                if candidate is not None:
                    return candidate

        # No matches found
        return None