def _pre_loop_setup(self, message):
    super(RemoteChildLoop, self)._pre_loop_setup(message)
    self._setup_metadata = self._send_and_expect(message, message.MetadataPull, message.Metadata).data
    if self._setup_metadata.env:
        for (key, value) in self._setup_metadata.env.items():
            os.environ[key] = value
    if self._setup_metadata.setup_script:
        if subprocess.call(self._setup_metadata.setup_script, stdout=sys.stdout, stderr=sys.stderr):
            raise RuntimeError('Setup script exited with non 0 code.')
def _pre_loop_setup(self, message):
    super(RemoteChildLoop, self)._pre_loop_setup(message)
    self._setup_metadata = self._send_and_expect(message, message.MetadataPull, message.Metadata).data
    if self._setup_metadata.env:
        for (key, value) in self._setup_metadata.env.items():
            os.environ[key] = value
    if self._setup_metadata.setup_script:
        if subprocess.call(self._setup_metadata.setup_script, stdout=sys.stdout, stderr=sys.stderr):
            raise RuntimeError('Setup script exited with non 0 code.')