mirror of https://github.com/apache/jclouds.git
VirtualBox: Removed private propagate-methods and use Google directly instead. Minor code cleanup.
This commit is contained in:
parent
2dfdbb4b56
commit
82e44d952b
|
@ -55,7 +55,7 @@ public class AttachNATAdapterToMachineIfNotAlreadyExists implements Function<IMa
|
|||
networkAdapter.getNatDriver().addRedirect(ruleName, rule.getProtocol(), rule.getHost(), rule.getHostPort(),
|
||||
rule.getGuest(), rule.getGuestPort());
|
||||
} catch (VBoxException e) {
|
||||
if (e.getMessage().indexOf("already exists") == -1)
|
||||
if (!e.getMessage().contains("already exists"))
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -83,7 +83,8 @@ public class RetrieveActiveBridgedInterfaces implements Function<NodeMetadata, L
|
|||
}
|
||||
} catch (SocketException e) {
|
||||
logger.error(e, "Problem in listing network interfaces.");
|
||||
propagate(e);
|
||||
Throwables.propagate(e);
|
||||
assert false;
|
||||
}
|
||||
return activeNetworkInterfaceNames;
|
||||
}
|
||||
|
@ -109,12 +110,6 @@ public class RetrieveActiveBridgedInterfaces implements Function<NodeMetadata, L
|
|||
return bridgedInterfaceNames;
|
||||
}
|
||||
|
||||
protected <T> T propagate(Exception e) {
|
||||
Throwables.propagate(e);
|
||||
assert false;
|
||||
return null;
|
||||
}
|
||||
|
||||
private class IsActiveBridgedInterface implements Predicate<String> {
|
||||
|
||||
private NetworkInterface networkInterface;
|
||||
|
@ -130,7 +125,8 @@ public class RetrieveActiveBridgedInterfaces implements Function<NodeMetadata, L
|
|||
.isLoopback());
|
||||
} catch (SocketException e) {
|
||||
logger.error(e, "Problem in listing network interfaces.");
|
||||
propagate(e);
|
||||
Throwables.propagate(e);
|
||||
assert false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -68,18 +68,13 @@ public class TakeSnapshotIfNotAlreadyAttached implements Function<IMachine, ISna
|
|||
logger.debug("Snapshot %s (description: %s) taken from %s", snapshotName, snapshotDesc, machine.getName());
|
||||
} catch (Exception e) {
|
||||
logger.error(e, "Problem creating snapshot %s (descripton: %s) from machine %s", snapshotName, snapshotDesc, machine.getName());
|
||||
propogate(e);
|
||||
Throwables.propagate(e);
|
||||
assert false;
|
||||
} finally {
|
||||
session.unlockMachine();
|
||||
}
|
||||
}
|
||||
return machine.getCurrentSnapshot();
|
||||
}
|
||||
|
||||
protected <T> T propogate(Exception e) {
|
||||
Throwables.propagate(e);
|
||||
assert false;
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue