20282 - Puppet agent; nodes file with spaces

Identities can only match /^[\w\.\-]+$/ which is enforced in the config
class.

The flatfile discovery method exist so that someone can put a bunch of
identities in a file and use that for discovery, thus the identities
have to adhere to the same rules but this check was never done which in
some circumstances could result in incorrect 'No responses from' errors
etc.

This commit enforces the same check when reading flatfiles resulting in
an error to the user when they have an error in their file