Skip to content

Commit 2c0a3ba

Browse files
committed
typing: Use consistent types
Resolve 'Incompatible types in assignment' errors. Change-Id: I1ea186ff766e0f72cac384fab22d1c2f82e02ef0 Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
1 parent 7380fbe commit 2c0a3ba

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

openstackclient/network/v2/network_trunk.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"""Network trunk and subports action implementations"""
1818

1919
import logging
20+
import typing as ty
2021

2122
from cliff import columns as cliff_columns
2223
from osc_lib.cli import format_columns
@@ -343,7 +344,7 @@ def _get_columns(item):
343344

344345

345346
def _get_attrs_for_trunk(client_manager, parsed_args):
346-
attrs = {}
347+
attrs: dict[str, ty.Any] = {}
347348
if parsed_args.name is not None:
348349
attrs['name'] = str(parsed_args.name)
349350
if parsed_args.description is not None:
@@ -400,7 +401,7 @@ def _format_subports(client_manager, subports):
400401

401402

402403
def _get_attrs_for_subports(client_manager, parsed_args):
403-
attrs = {}
404+
attrs = []
404405
if 'set_subports' in parsed_args and parsed_args.set_subports is not None:
405406
attrs = _format_subports(client_manager, parsed_args.set_subports)
406407
if (

openstackclient/tests/functional/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ def execute(cmd, *, fail_ok=False):
3636

3737
proc = subprocess.Popen(cmdlist, stdout=stdout, stderr=stderr, env=env)
3838

39-
result_out, result_err = proc.communicate()
40-
result_out = result_out.decode('utf-8')
39+
result_out_b, result_err = proc.communicate()
40+
result_out = result_out_b.decode('utf-8')
4141
LOG.debug('stdout: %s', result_out)
4242
LOG.debug('stderr: %s', result_err)
4343

0 commit comments

Comments
 (0)