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();
String[] rbdPoolAndVolumeAndSnapshot = snapshotRelPath.split("/");
int snapshotIndex = rbdPoolAndVolumeAndSnapshot.length - 1;
String rbdSnapshotId = rbdPoolAndVolumeAndSnapshot[snapshotIndex];
IoCTX io = rados.ioCtxCreate(primaryPool.getSourceDir());
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(),
rbdPoolAndVolumeAndSnapshot[0], rbdPoolAndVolumeAndSnapshot[1], rbdPoolAndVolumeAndSnapshot[2]));
image.snapRollBack(rbdPoolAndVolumeAndSnapshot[2]);
s_logger.debug(String.format("Attempting to rollback RBD snapshot [name:%s], [volumeid:%s], [snapshotid:%s]", snapshot.getName(), volumePath, rbdSnapshotId));
RbdImage image = rbd.open(volumePath);
image.snapRollBack(rbdSnapshotId);
rbd.close(image);
rados.ioCtxDestroy(io);

View File

@ -79,7 +79,7 @@ class CsRoute:
found = False
search = cmd
if "throw" in search:
search = "type " + search
search = search.replace("throw", "")
for i in CsHelper.execute("ip route show " + search):
found = True
if not found and method == "add":