mypy: Address issues with openstack.orchestration
Change-Id: I181b1ddee04b2514283b4d742e74b9bd54790414 Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
This commit is contained in:
@@ -63,7 +63,6 @@ repos:
|
|||||||
| openstack/key_manager/.*
|
| openstack/key_manager/.*
|
||||||
| openstack/load_balancer/.*
|
| openstack/load_balancer/.*
|
||||||
| openstack/message/.*
|
| openstack/message/.*
|
||||||
| openstack/orchestration/.*
|
|
||||||
| openstack/placement/.*
|
| openstack/placement/.*
|
||||||
| openstack/shared_file_system/.*
|
| openstack/shared_file_system/.*
|
||||||
| openstack/workflow/.*
|
| openstack/workflow/.*
|
||||||
|
@@ -17,7 +17,7 @@ import yaml
|
|||||||
if hasattr(yaml, 'CSafeLoader'):
|
if hasattr(yaml, 'CSafeLoader'):
|
||||||
yaml_loader = yaml.CSafeLoader
|
yaml_loader = yaml.CSafeLoader
|
||||||
else:
|
else:
|
||||||
yaml_loader = yaml.SafeLoader
|
yaml_loader = yaml.SafeLoader # type: ignore
|
||||||
|
|
||||||
|
|
||||||
class HeatYamlLoader(yaml_loader):
|
class HeatYamlLoader(yaml_loader):
|
||||||
|
@@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
import collections.abc
|
import collections.abc
|
||||||
import json
|
import json
|
||||||
|
import typing as ty
|
||||||
from urllib import parse
|
from urllib import parse
|
||||||
from urllib import request
|
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
|
:return: tuple of files dict and a dict of the consolidated environment
|
||||||
:rtype: tuple
|
:rtype: tuple
|
||||||
"""
|
"""
|
||||||
merged_files = {}
|
merged_files: ty.Dict[str, str] = {}
|
||||||
merged_env = {}
|
merged_env: ty.Dict[str, ty.Dict] = {}
|
||||||
|
|
||||||
# If we're keeping a list of environment files separately, include the
|
# If we're keeping a list of environment files separately, include the
|
||||||
# contents of the files in the files dict
|
# 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
|
:return: tuple of files dict and the loaded environment as a dict
|
||||||
:rtype: (dict, dict)
|
:rtype: (dict, dict)
|
||||||
"""
|
"""
|
||||||
files = {}
|
files: ty.Dict[str, str] = {}
|
||||||
env = {}
|
env: ty.Dict[str, ty.Dict] = {}
|
||||||
|
|
||||||
is_object = env_path_is_object and env_path_is_object(env_path)
|
is_object = env_path_is_object and env_path_is_object(env_path)
|
||||||
|
|
||||||
|
@@ -29,9 +29,9 @@ class StackEnvironment(resource.Resource):
|
|||||||
# Backwards compat
|
# Backwards compat
|
||||||
stack_name = name
|
stack_name = name
|
||||||
#: ID of the stack where the template is referenced.
|
#: ID of the stack where the template is referenced.
|
||||||
id = resource.URI('stack_id')
|
id = resource.URI('stack_id') # type: ignore
|
||||||
# Backwards compat
|
# Backwards compat
|
||||||
stack_id = id
|
stack_id = id # type: ignore
|
||||||
#: A list of parameter names whose values are encrypted
|
#: A list of parameter names whose values are encrypted
|
||||||
encrypted_param_names = resource.Body('encrypted_param_names')
|
encrypted_param_names = resource.Body('encrypted_param_names')
|
||||||
#: A list of event sinks
|
#: A list of event sinks
|
||||||
|
@@ -29,9 +29,9 @@ class StackFiles(resource.Resource):
|
|||||||
# Backwards compat
|
# Backwards compat
|
||||||
stack_name = name
|
stack_name = name
|
||||||
#: ID of the stack where the template is referenced.
|
#: ID of the stack where the template is referenced.
|
||||||
id = resource.URI('stack_id')
|
id = resource.URI('stack_id') # type: ignore
|
||||||
# Backwards compat
|
# Backwards compat
|
||||||
stack_id = id
|
stack_id = id # type: ignore
|
||||||
|
|
||||||
def fetch(self, session, base_path=None):
|
def fetch(self, session, base_path=None):
|
||||||
# The stack files response contains a map of filenames and file
|
# The stack files response contains a map of filenames and file
|
||||||
|
@@ -466,7 +466,7 @@ class Resource(dict):
|
|||||||
id = Body("id")
|
id = Body("id")
|
||||||
|
|
||||||
#: The name of this resource.
|
#: The name of this resource.
|
||||||
name = Body("name")
|
name: ty.Union[Body, URI] = Body("name")
|
||||||
#: The OpenStack location of this resource.
|
#: The OpenStack location of this resource.
|
||||||
location: ty.Union[Computed, Body] = Computed('location')
|
location: ty.Union[Computed, Body] = Computed('location')
|
||||||
|
|
||||||
|
@@ -57,7 +57,6 @@ exclude = (?x)(
|
|||||||
| openstack/key_manager
|
| openstack/key_manager
|
||||||
| openstack/load_balancer
|
| openstack/load_balancer
|
||||||
| openstack/message
|
| openstack/message
|
||||||
| openstack/orchestration
|
|
||||||
| openstack/placement
|
| openstack/placement
|
||||||
| openstack/shared_file_system
|
| openstack/shared_file_system
|
||||||
| openstack/workflow
|
| openstack/workflow
|
||||||
|
Reference in New Issue
Block a user