Only compile the template contents if they evaluate to True
Only compile the template contents if they evaluate to True

When getting all the top files for the various environments, those
environments without a top file will return ``False`` when we attempt to
cache the file. Passing a boolean to ``compile_template()`` will result
in an error being logged, since we are invoking the function incorrectly
(it expects the template data to be a string).

Since a ``False`` return from caching the file means that it does not
exist, this commit will only run ``compile_template()`` when the
contents evaluate to ``True``.

Resolves #33424.

saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt