Fixes #7580 - wrap newer code in checks for older foreman versions