mypy: Address issues with openstack.orchestration

Change-Id: I181b1ddee04b2514283b4d742e74b9bd54790414
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
This commit is contained in:
Stephen Finucane 2023-07-27 10:14:49 +01:00
parent 4c1ced6ae2
commit a7cfc5342f
7 changed files with 11 additions and 12 deletions

View File

@ -63,7 +63,6 @@ repos:
| openstack/key_manager/.*
| openstack/load_balancer/.*
| openstack/message/.*
| openstack/orchestration/.*
| openstack/placement/.*
| openstack/shared_file_system/.*
| openstack/workflow/.*

View File

@ -17,7 +17,7 @@ import yaml
if hasattr(yaml, 'CSafeLoader'):
yaml_loader = yaml.CSafeLoader
else:
yaml_loader = yaml.SafeLoader
yaml_loader = yaml.SafeLoader # type: ignore
class HeatYamlLoader(yaml_loader):

View File

@ -14,6 +14,7 @@
import collections.abc
import json
import typing as ty
from urllib import parse
from urllib import request
@ -221,8 +222,8 @@ def process_multiple_environments_and_files(
:return: tuple of files dict and a dict of the consolidated environment
:rtype: tuple
"""
merged_files = {}
merged_env = {}
merged_files: ty.Dict[str, str] = {}
merged_env: ty.Dict[str, ty.Dict] = {}
# If we're keeping a list of environment files separately, include the
# contents of the files in the files dict
@ -275,8 +276,8 @@ def process_environment_and_files(
:return: tuple of files dict and the loaded environment as a dict
:rtype: (dict, dict)
"""
files = {}
env = {}
files: ty.Dict[str, str] = {}
env: ty.Dict[str, ty.Dict] = {}
is_object = env_path_is_object and env_path_is_object(env_path)

View File

@ -29,9 +29,9 @@ class StackEnvironment(resource.Resource):
# Backwards compat
stack_name = name
#: ID of the stack where the template is referenced.
id = resource.URI('stack_id')
id = resource.URI('stack_id') # type: ignore
# Backwards compat
stack_id = id
stack_id = id # type: ignore
#: A list of parameter names whose values are encrypted
encrypted_param_names = resource.Body('encrypted_param_names')
#: A list of event sinks

View File

@ -29,9 +29,9 @@ class StackFiles(resource.Resource):
# Backwards compat
stack_name = name
#: ID of the stack where the template is referenced.
id = resource.URI('stack_id')
id = resource.URI('stack_id') # type: ignore
# Backwards compat
stack_id = id
stack_id = id # type: ignore
def fetch(self, session, base_path=None):
# The stack files response contains a map of filenames and file

View File

@ -466,7 +466,7 @@ class Resource(dict):
id = Body("id")
#: The name of this resource.
name = Body("name")
name: ty.Union[Body, URI] = Body("name")
#: The OpenStack location of this resource.
location: ty.Union[Computed, Body] = Computed('location')

View File

@ -57,7 +57,6 @@ exclude = (?x)(
| openstack/key_manager
| openstack/load_balancer
| openstack/message
| openstack/orchestration
| openstack/placement
| openstack/shared_file_system
| openstack/workflow