Merge remote-tracking branch 'origin/4.13'

This commit is contained in:
Rohit Yadav 2019-11-12 15:06:50 +05:30
commit 96d98de85c
2 changed files with 7 additions and 5 deletions

View File

@ -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);

View File

@ -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":