diff --git a/src/main/java/org/jenkinsci/plugins/proxmox/VirtualMachineSlaveComputer.java b/src/main/java/org/jenkinsci/plugins/proxmox/VirtualMachineSlaveComputer.java index d9568f5..60ddc3e 100644 --- a/src/main/java/org/jenkinsci/plugins/proxmox/VirtualMachineSlaveComputer.java +++ b/src/main/java/org/jenkinsci/plugins/proxmox/VirtualMachineSlaveComputer.java @@ -5,10 +5,6 @@ import java.util.concurrent.Future; import java.util.concurrent.atomic.AtomicBoolean; -import org.jvnet.localizer.Localizable; -import org.jvnet.localizer.ResourceBundleHolder; - -import hudson.Messages; import hudson.model.Executor; import hudson.model.Node; import hudson.model.Queue; @@ -18,11 +14,6 @@ public class VirtualMachineSlaveComputer extends SlaveComputer { - /** - * The resource bundle reference - * - */ - private final static ResourceBundleHolder holder = ResourceBundleHolder.get(Messages.class); private AtomicBoolean isRevertingSnapshot = new AtomicBoolean(false); public VirtualMachineSlaveComputer(Slave slave) { @@ -34,8 +25,8 @@ public void tryReconnect() { if(isRevertingSnapshot.get()) { getListener().getLogger().println("INFO: trying to reconnect while snapshot revert - ignoring"); return; - } - + } + super.tryReconnect(); } @@ -53,7 +44,7 @@ public void taskAccepted(Executor executor, Queue.Task task) { try { isRevertingSnapshot.set(true); - final Future disconnectFuture = disconnect(OfflineCause.create(new Localizable(holder, "Disconnect before snapshot revert"))); + final Future disconnectFuture = disconnect(OfflineCause.create(Messages._VirtualMachineSlaveComputer_disconnectBeforeSnapshotRevert())); disconnectFuture.get(); getListener().getLogger().println("INFO: slave disconnected"); diff --git a/src/main/resources/org/jenkinsci/plugins/proxmox/Messages.properties b/src/main/resources/org/jenkinsci/plugins/proxmox/Messages.properties new file mode 100644 index 0000000..bd44f06 --- /dev/null +++ b/src/main/resources/org/jenkinsci/plugins/proxmox/Messages.properties @@ -0,0 +1 @@ +VirtualMachineSlaveComputer.disconnectBeforeSnapshotRevert=Disconnect before snapshot revert \ No newline at end of file