Skip to content

Commit 703706c

Browse files
committed
Use python-native keyword-only arguments
... instead of implementing the same by own logic. Change-Id: I72f82bdfa965f0e5b68dd9a4df36979f2915b0c3 Signed-off-by: Takashi Kajinami <kajinamit@oss.nttdata.com>
1 parent 23b462d commit 703706c

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

nova/virt/libvirt/config.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,12 @@ def parse_libvirt_device_alias(alias):
5757

5858
class LibvirtConfigObject(object):
5959

60-
def __init__(self, **kwargs):
60+
def __init__(self, *, root_name, ns_prefix=None, ns_uri=None):
6161
super(LibvirtConfigObject, self).__init__()
6262

63-
self.root_name = kwargs.pop("root_name")
64-
self.ns_prefix = kwargs.pop("ns_prefix", None)
65-
self.ns_uri = kwargs.pop("ns_uri", None)
66-
67-
# handle programmer error
68-
assert not kwargs
63+
self.root_name = root_name
64+
self.ns_prefix = ns_prefix
65+
self.ns_uri = ns_uri
6966

7067
def _new_node(self, node_name, **kwargs):
7168
if self.ns_uri is None:

0 commit comments

Comments
 (0)