def _exec_plugin(self, osutils, service, plugin, instance_id, shared_data):
        plugin_name = plugin.get_name()

        status = None
        if instance_id is not None:
            status = self._get_plugin_status(osutils, instance_id, plugin_name)
        if status == plugins_base.PLUGIN_EXECUTION_DONE:
            LOG.debug('Plugin \'%s\' execution already done, skipping',
                      plugin_name)
        else:
            LOG.info('Executing plugin \'%s\'', plugin_name)
            try:
                (status, reboot_required) = plugin.execute(service,
                                                           shared_data)
                if instance_id is not None:
                    self._set_plugin_status(osutils, instance_id, plugin_name,
                                            status)
                return reboot_required
            except Exception as ex:
                LOG.error('plugin \'%(plugin_name)s\' failed with error '
                          '\'%(ex)s\'', {'plugin_name': plugin_name, 'ex': ex})
                LOG.exception(ex)
dataset/ETHPy150Open openstack/cloudbase-init/cloudbaseinit/init.py/InitManager._exec_plugin/original