mirror of
https://opendev.org/openstack/python-openstackclient.git
synced 2026-01-17 07:20:45 +00:00
typing: Use consistent types
Resolve 'Incompatible types in assignment' errors. Change-Id: I1ea186ff766e0f72cac384fab22d1c2f82e02ef0 Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
This commit is contained in:
parent
7380fbe300
commit
2c0a3ba137
2 changed files with 5 additions and 4 deletions
|
|
@ -17,6 +17,7 @@
|
|||
"""Network trunk and subports action implementations"""
|
||||
|
||||
import logging
|
||||
import typing as ty
|
||||
|
||||
from cliff import columns as cliff_columns
|
||||
from osc_lib.cli import format_columns
|
||||
|
|
@ -343,7 +344,7 @@ def _get_columns(item):
|
|||
|
||||
|
||||
def _get_attrs_for_trunk(client_manager, parsed_args):
|
||||
attrs = {}
|
||||
attrs: dict[str, ty.Any] = {}
|
||||
if parsed_args.name is not None:
|
||||
attrs['name'] = str(parsed_args.name)
|
||||
if parsed_args.description is not None:
|
||||
|
|
@ -400,7 +401,7 @@ def _format_subports(client_manager, subports):
|
|||
|
||||
|
||||
def _get_attrs_for_subports(client_manager, parsed_args):
|
||||
attrs = {}
|
||||
attrs = []
|
||||
if 'set_subports' in parsed_args and parsed_args.set_subports is not None:
|
||||
attrs = _format_subports(client_manager, parsed_args.set_subports)
|
||||
if (
|
||||
|
|
|
|||
|
|
@ -36,8 +36,8 @@ def execute(cmd, *, fail_ok=False):
|
|||
|
||||
proc = subprocess.Popen(cmdlist, stdout=stdout, stderr=stderr, env=env)
|
||||
|
||||
result_out, result_err = proc.communicate()
|
||||
result_out = result_out.decode('utf-8')
|
||||
result_out_b, result_err = proc.communicate()
|
||||
result_out = result_out_b.decode('utf-8')
|
||||
LOG.debug('stdout: %s', result_out)
|
||||
LOG.debug('stderr: %s', result_err)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue