qapi/commands.py: Don't re-bind to variable of different type
authorJohn Snow <jsnow@redhat.com>
Fri, 9 Oct 2020 16:15:43 +0000 (12:15 -0400)
committerMarkus Armbruster <armbru@redhat.com>
Sat, 10 Oct 2020 09:37:48 +0000 (11:37 +0200)
Mypy isn't a fan of rebinding a variable with a new data type.
It's easy enough to avoid.

Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Cleber Rosa <crosa@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20201009161558.107041-22-jsnow@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
scripts/qapi/commands.py

index 88ba11c40e193292d5863f9f2cbe457b3fa20c19..b0abb985a4e628a638c29df7f8317ebf79a99100 100644 (file)
@@ -198,14 +198,12 @@ def gen_register_command(name, success_response, allow_oob, allow_preconfig,
     if not options:
         options = ['QCO_NO_OPTIONS']
 
-    options = " | ".join(options)
-
     ret = mcgen('''
     qmp_register_command(cmds, "%(name)s",
                          qmp_marshal_%(c_name)s, %(opts)s);
 ''',
                 name=name, c_name=c_name(name),
-                opts=options)
+                opts=" | ".join(options))
     return ret