lots of changes to detect local/spawning puppetmaster