Both of these functions return a list, not a tuple, and by manually
tracing the code, we can see they always return non-empty lists.

Change the callers to get the first element of the list rather than
using destructuring.

No functional change.

Signed-off-by: Brian Foley <bpfo...@google.com>
---
 lib/cmdlib/instance_storage.py | 4 ++--
 lib/rpc/node.py                | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/cmdlib/instance_storage.py b/lib/cmdlib/instance_storage.py
index af1c2e8..3abc5f8 100644
--- a/lib/cmdlib/instance_storage.py
+++ b/lib/cmdlib/instance_storage.py
@@ -596,8 +596,8 @@ def GenerateDiskTemplate(
       raise errors.ProgrammerError("Wrong template configuration")
     remote_node_uuid = secondary_node_uuids[0]
 
-    (drbd_params, _, _) = objects.Disk.ComputeLDParams(template_name,
-                                                       full_disk_params)
+    drbd_params = objects.Disk.ComputeLDParams(template_name,
+                                               full_disk_params)[0]
     drbd_default_metavg = drbd_params[constants.LDP_DEFAULT_METAVG]
 
     names = []
diff --git a/lib/rpc/node.py b/lib/rpc/node.py
index cd2050d..f8bfa79 100644
--- a/lib/rpc/node.py
+++ b/lib/rpc/node.py
@@ -953,7 +953,7 @@ class RpcRunner(_RpcClientBase,
     """Wrapper for L{AnnotateDiskParams}.
 
     """
-    (anno_disk,) = self._DisksDictDP(node, ([disk], instance))
+    anno_disk = self._DisksDictDP(node, ([disk], instance))[0]
     return anno_disk
 
   def _EncodeNodeToDiskDictDP(self, node, value):
-- 
2.8.0.rc3.226.g39d4020

Reply via email to