File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -61,7 +61,7 @@ def take_action(self, parsed_args):
6161 # TODO(bapalm): Fix this when cliff properly supports
6262 # handling the detection rather than using the hard-code below.
6363 if parsed_args .formatter == 'table' :
64- command_names = utils .format_list (command_names , "\n " ) # type: ignore
64+ command_names = utils .format_list (command_names , "\n " ) # type: ignore[assignment]
6565
6666 commands .append ((group , command_names ))
6767
Original file line number Diff line number Diff line change @@ -1909,6 +1909,7 @@ def _match_image(image_api, wanted_properties):
19091909
19101910 networks = parsed_args .nics [0 ]
19111911 else :
1912+ _networks = []
19121913 for nic in parsed_args .nics :
19131914 if 'tag' in nic :
19141915 if not sdk_utils .supports_microversion (
@@ -1969,7 +1970,8 @@ def _match_image(image_api, wanted_properties):
19691970 if nic .get ('tag' ): # tags are optional
19701971 network ['tag' ] = nic ['tag' ]
19711972
1972- networks .append (network ) # type: ignore[union-attr]
1973+ _networks .append (network )
1974+ networks = _networks
19731975
19741976 if not parsed_args .nics and sdk_utils .supports_microversion (
19751977 compute_client , '2.37'
Original file line number Diff line number Diff line change @@ -314,10 +314,10 @@ def take_action(self, parsed_args):
314314 else :
315315 # Read file from stdin
316316 if not sys .stdin .isatty ():
317- if os . name == "nt " :
317+ if sys . platform == "win32 " :
318318 import msvcrt
319319
320- msvcrt .setmode (sys .stdin .fileno (), os .O_BINARY ) # type: ignore
320+ msvcrt .setmode (sys .stdin .fileno (), os .O_BINARY )
321321 if hasattr (sys .stdin , 'buffer' ):
322322 kwargs ['data' ] = sys .stdin .buffer
323323 else :
@@ -785,10 +785,10 @@ def take_action(self, parsed_args):
785785 # Read file from stdin
786786 if sys .stdin .isatty () is not True :
787787 if parsed_args .stdin :
788- if os . name == "nt " :
788+ if sys . platform == "win32 " :
789789 import msvcrt
790790
791- msvcrt .setmode (sys .stdin .fileno (), os .O_BINARY ) # type: ignore
791+ msvcrt .setmode (sys .stdin .fileno (), os .O_BINARY )
792792 if hasattr (sys .stdin , 'buffer' ):
793793 kwargs ['data' ] = sys .stdin .buffer
794794 else :
Original file line number Diff line number Diff line change @@ -166,10 +166,10 @@ def get_data_from_stdin():
166166 image = sys .stdin
167167 if hasattr (sys .stdin , 'buffer' ):
168168 image = sys .stdin .buffer
169- if os . name == "nt " :
169+ if sys . platform == "win32 " :
170170 import msvcrt
171171
172- msvcrt .setmode (sys .stdin .fileno (), os .O_BINARY ) # type: ignore
172+ msvcrt .setmode (sys .stdin .fileno (), os .O_BINARY )
173173
174174 return image
175175 else :
Original file line number Diff line number Diff line change 1414
1515"""Volume v2 Type action implementations"""
1616
17+ from collections .abc import MutableMapping
1718import functools
1819import logging
1920from typing import Any
@@ -439,7 +440,9 @@ def take_action(self, parsed_args):
439440 is_public = parsed_args .is_public ,
440441 )
441442
442- formatters = {'Extra Specs' : format_columns .DictColumn }
443+ formatters : MutableMapping [str , Any ] = {
444+ 'Extra Specs' : format_columns .DictColumn
445+ }
443446
444447 if parsed_args .encryption_type :
445448 encryption = {}
@@ -466,7 +469,7 @@ def take_action(self, parsed_args):
466469 _EncryptionInfoColumn = functools .partial (
467470 EncryptionInfoColumn , encryption_data = encryption
468471 )
469- formatters ['id' ] = _EncryptionInfoColumn # type: ignore
472+ formatters ['id' ] = _EncryptionInfoColumn
470473
471474 return (
472475 column_headers ,
Original file line number Diff line number Diff line change 1313
1414"""Volume v3 Type action implementations"""
1515
16+ from collections .abc import MutableMapping
1617import functools
1718import logging
1819from typing import Any
@@ -522,7 +523,9 @@ def take_action(self, parsed_args):
522523 is_public = parsed_args .is_public ,
523524 )
524525
525- formatters = {'Extra Specs' : format_columns .DictColumn }
526+ formatters : MutableMapping [str , Any ] = {
527+ 'Extra Specs' : format_columns .DictColumn
528+ }
526529
527530 if parsed_args .encryption_type :
528531 encryption = {}
@@ -549,7 +552,7 @@ def take_action(self, parsed_args):
549552 _EncryptionInfoColumn = functools .partial (
550553 EncryptionInfoColumn , encryption_data = encryption
551554 )
552- formatters ['id' ] = _EncryptionInfoColumn # type: ignore
555+ formatters ['id' ] = _EncryptionInfoColumn
553556
554557 return (
555558 column_headers ,
You can’t perform that action at this time.
0 commit comments