Fix main build failing
Fix main build failing

An old PR (#7623) was merged after #9585. The old code was incompatible with the new
changes, but none of the lines caused a git conflict so the merge was allowed.

The incompatible changes caused the tests to fail. This fixes the old code to
work with the new changes.

hashicorp/consul,hashicorp/consul,hashicorp/consul,hashicorp/consul