Display warning when running st2-register-content tool if pack contains
deprecated config.yaml file.
@@ -139,6 +139,18 @@ class ResourceRegistrar(object):
# 1. Register pack
pack_db = self._register_pack_db(pack_name=pack_name, pack_dir=pack_dir)
+ # Display a warning if pack contains deprecated config.yaml file. Support for those files
+ # will be fully removed in v2.4.0.
+ config_path = os.path.join(pack_dir, 'config.yaml')
+ if os.path.isfile(config_path):
+ LOG.warning('Pack "%s" contains a deprecated config.yaml file (%s).'
+ 'Support for "config.yaml" files has been deprecated in StackStorm v1.6.0 '
+ 'in favor of config.schema.yaml config schema files and config files in '
+ ' /opt/stackstorm/configs/ directory.'
+ 'Support for config.yaml files will be removed in next major release '
+ ' (v2.4.0) so you are strongly encouraged to migrate.' %
+ (pack_db.name, config_path))
+
# 2. Register corresponding pack config schema
config_schema_db = self._register_pack_config_schema_db(pack_name=pack_name,
pack_dir=pack_dir)
