Skip to content

Commit

Permalink
reformat with black
Browse files Browse the repository at this point in the history
  • Loading branch information
cognifloyd committed Jul 23, 2022
1 parent 6f8b52c commit 6e9d0d6
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions st2common/st2common/util/config_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ def _get_values_for_config(self, config_schema_db, config_db):

# If config_schema is available we do a second pass and set default values for required
# items which values are not provided / available in the config itself
config = self._assign_subschema_default_values(schema=schema_values, instance=config)
config = self._assign_subschema_default_values(
schema=schema_values, instance=config
)
return config

@staticmethod
Expand Down Expand Up @@ -342,16 +344,10 @@ def _assign_default_values(self, schema, instance, can_replace_instance=False):
if schema_type == "object":
has_properties = schema.get("properties", None)
has_pattern_properties = schema.get("patternProperties", None)
has_additional_properties = schema.get(
"additionalProperties", None
)
has_additional_properties = schema.get("additionalProperties", None)

# Inspect nested object properties
if (
has_properties
or has_pattern_properties
or has_additional_properties
):
if has_properties or has_pattern_properties or has_additional_properties:
if not instance:
instance = {}

Expand Down

0 comments on commit 6e9d0d6

Please sign in to comment.