mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Merge remote-tracking branch 'origin/4.13'
This commit is contained in:
commit
96d98de85c
@ -86,14 +86,16 @@ public final class LibvirtRevertSnapshotCommandWrapper extends CommandWrapper<Re
|
|||||||
rados.connect();
|
rados.connect();
|
||||||
|
|
||||||
String[] rbdPoolAndVolumeAndSnapshot = snapshotRelPath.split("/");
|
String[] rbdPoolAndVolumeAndSnapshot = snapshotRelPath.split("/");
|
||||||
|
int snapshotIndex = rbdPoolAndVolumeAndSnapshot.length - 1;
|
||||||
|
String rbdSnapshotId = rbdPoolAndVolumeAndSnapshot[snapshotIndex];
|
||||||
|
|
||||||
IoCTX io = rados.ioCtxCreate(primaryPool.getSourceDir());
|
IoCTX io = rados.ioCtxCreate(primaryPool.getSourceDir());
|
||||||
Rbd rbd = new Rbd(io);
|
Rbd rbd = new Rbd(io);
|
||||||
RbdImage image = rbd.open(rbdPoolAndVolumeAndSnapshot[1]);
|
|
||||||
|
|
||||||
s_logger.debug(String.format("Attempting to rollback RBD snapshot [name:%s], [pool:%s], [volumeid:%s], [snapshotid:%s]", snapshot.getName(),
|
s_logger.debug(String.format("Attempting to rollback RBD snapshot [name:%s], [volumeid:%s], [snapshotid:%s]", snapshot.getName(), volumePath, rbdSnapshotId));
|
||||||
rbdPoolAndVolumeAndSnapshot[0], rbdPoolAndVolumeAndSnapshot[1], rbdPoolAndVolumeAndSnapshot[2]));
|
|
||||||
image.snapRollBack(rbdPoolAndVolumeAndSnapshot[2]);
|
RbdImage image = rbd.open(volumePath);
|
||||||
|
image.snapRollBack(rbdSnapshotId);
|
||||||
|
|
||||||
rbd.close(image);
|
rbd.close(image);
|
||||||
rados.ioCtxDestroy(io);
|
rados.ioCtxDestroy(io);
|
||||||
|
|||||||
@ -79,7 +79,7 @@ class CsRoute:
|
|||||||
found = False
|
found = False
|
||||||
search = cmd
|
search = cmd
|
||||||
if "throw" in search:
|
if "throw" in search:
|
||||||
search = "type " + search
|
search = search.replace("throw", "")
|
||||||
for i in CsHelper.execute("ip route show " + search):
|
for i in CsHelper.execute("ip route show " + search):
|
||||||
found = True
|
found = True
|
||||||
if not found and method == "add":
|
if not found and method == "add":
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user