Skip to content

Commit 0a36219

Browse files
committed
fix types
1 parent b099a16 commit 0a36219

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

libvirtnbdbackup/restore/disk.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,6 @@ def restore( # pylint: disable=too-many-branches
118118

119119
if args.adjust_config is True:
120120
restConfig = vmconfig.removeUuid(restConfig.decode())
121-
restConfig = vmconfig.setVMName(args, restConfig)
121+
restConfig = vmconfig.setVMName(args, restConfig.decode())
122122

123123
return restConfig

libvirtnbdbackup/restore/vmconfig.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ def removeUuid(vmConfig: str) -> bytes:
5454
"""Remove the auto generated UUID from the config file to allow
5555
for restore into new name"""
5656
tree = xml.asTree(vmConfig)
57-
5857
try:
5958
logging.info("Removing uuid setting from vm config.")
6059
uuid = tree.xpath("uuid")[0]
@@ -65,7 +64,7 @@ def removeUuid(vmConfig: str) -> bytes:
6564
return xml.ElementTree.tostring(tree, encoding="utf8", method="xml")
6665

6766

68-
def setVMName(args: Namespace, vmConfig: bytes) -> bytes:
67+
def setVMName(args: Namespace, vmConfig: str) -> bytes:
6968
"""Change / set the VM name to be restored"""
7069
tree = xml.asTree(vmConfig)
7170
name = tree.xpath("name")[0]

0 commit comments

Comments
 (0)