[PackageConfigSchema.specfile_path_pre()] better log messages
import logging
import typing
+from typing import Dict
from marshmallow import Schema, fields, post_load, pre_load, ValidationError
from marshmallow_enum import EnumField
@@ -257,10 +258,10 @@ class PackageConfigSchema(Schema):
del data[old_key_name]
return data
- def specfile_path_pre(self, data, **kwargs):
+ def specfile_path_pre(self, data: Dict, **kwargs):
"""
- Method for pre-processing specfile_path value. If is None, will try to generate from,
- donwstream_package_name, else will keep None and generate warning.
+ Method for pre-processing specfile_path value.
+ Set it to downstream_package_name if specified, else leave unset.
:param data: conf dictionary to process
:return: processed dictionary
@@ -271,10 +272,10 @@ class PackageConfigSchema(Schema):
downstream_package_name = data.get("downstream_package_name", None)
if downstream_package_name:
data["specfile_path"] = f"{downstream_package_name}.spec"
- logger.info(f"We guess that spec file is at {specfile_path}")
+ logger.info(f"Setting specfile_path to {downstream_package_name}.spec")
else:
# guess it?
- logger.warning("Path to spec file is not set.")
+ logger.info("Neither specfile_path nor downstream_package_name set.")
return data
@post_load
