Compare commits
2 commits
fbba016007
...
b120dd8e69
| Author | SHA1 | Date | |
|---|---|---|---|
| b120dd8e69 | |||
| 64e2d137c5 |
9 changed files with 32 additions and 10 deletions
|
|
@ -1,3 +1,9 @@
|
||||||
|
## 1.2.0a35 (2025-10-02)
|
||||||
|
|
||||||
|
### Feat
|
||||||
|
|
||||||
|
- add warning class
|
||||||
|
|
||||||
## 1.2.0a34 (2025-09-30)
|
## 1.2.0a34 (2025-09-30)
|
||||||
|
|
||||||
### Feat
|
### Feat
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
[project]
|
[project]
|
||||||
name = "rougail"
|
name = "rougail"
|
||||||
version = "1.2.0a34"
|
version = "1.2.0a35"
|
||||||
|
|
||||||
[tool.commitizen]
|
[tool.commitizen]
|
||||||
name = "cz_conventional_commits"
|
name = "cz_conventional_commits"
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ requires = ["flit_core >=3.8.0,<4"]
|
||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "rougail-base"
|
name = "rougail-base"
|
||||||
version = "1.2.0a34"
|
version = "1.2.0a35"
|
||||||
authors = [{name = "Emmanuel Garette", email = "gnunux@gnunux.info"}]
|
authors = [{name = "Emmanuel Garette", email = "gnunux@gnunux.info"}]
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
description = "A consistency handling system that was initially designed in the configuration management"
|
description = "A consistency handling system that was initially designed in the configuration management"
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ requires = ["flit_core >=3.8.0,<4"]
|
||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "rougail"
|
name = "rougail"
|
||||||
version = "1.2.0a34"
|
version = "1.2.0a35"
|
||||||
authors = [{name = "Emmanuel Garette", email = "gnunux@gnunux.info"}]
|
authors = [{name = "Emmanuel Garette", email = "gnunux@gnunux.info"}]
|
||||||
description = "A consistency handling system that was initially designed in the configuration management"
|
description = "A consistency handling system that was initially designed in the configuration management"
|
||||||
classifiers = [
|
classifiers = [
|
||||||
|
|
@ -18,7 +18,7 @@ classifiers = [
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"ruamel.yaml ~= 0.18.6",
|
"ruamel.yaml ~= 0.18.6",
|
||||||
"pydantic ~= 2.9.2",
|
"pydantic ~= 2.9.2",
|
||||||
"rougail-base == 1.2.0a34",
|
"rougail-base == 1.2.0a35",
|
||||||
]
|
]
|
||||||
|
|
||||||
[tool.flit.sdist]
|
[tool.flit.sdist]
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
__version__ = "1.2.0a34"
|
__version__ = "1.2.0a35"
|
||||||
|
|
|
||||||
|
|
@ -116,14 +116,20 @@ class Annotator(Walk): # pylint: disable=R0903
|
||||||
continue
|
continue
|
||||||
if variable.type in RENAME_TYPE:
|
if variable.type in RENAME_TYPE:
|
||||||
warning = f'the variable "{ variable.path }" has a depreciated type "{variable.type}", please use "{RENAME_TYPE[variable.type]}" instead in {display_xmlfiles(variable.xmlfiles)}'
|
warning = f'the variable "{ variable.path }" has a depreciated type "{variable.type}", please use "{RENAME_TYPE[variable.type]}" instead in {display_xmlfiles(variable.xmlfiles)}'
|
||||||
warn(warning)
|
warn(warning,
|
||||||
|
DeprecationWarning,
|
||||||
|
)
|
||||||
variable.type = RENAME_TYPE[variable.type]
|
variable.type = RENAME_TYPE[variable.type]
|
||||||
if variable.type == 'cidr':
|
if variable.type == 'cidr':
|
||||||
warning = f'the variable "{ variable.path }" has a depreciated type "{variable.type}", please use type "ip" with attribute cidr=True instead in {display_xmlfiles(variable.xmlfiles)}'
|
warning = f'the variable "{ variable.path }" has a depreciated type "{variable.type}", please use type "ip" with attribute cidr=True instead in {display_xmlfiles(variable.xmlfiles)}'
|
||||||
warn(warning)
|
warn(warning,
|
||||||
|
DeprecationWarning,
|
||||||
|
)
|
||||||
if variable.type == 'network_cidr':
|
if variable.type == 'network_cidr':
|
||||||
warning = f'the variable "{ variable.path }" has a depreciated type "{variable.type}", please use type "network" with attribute cidr=True instead in {display_xmlfiles(variable.xmlfiles)}'
|
warning = f'the variable "{ variable.path }" has a depreciated type "{variable.type}", please use type "network" with attribute cidr=True instead in {display_xmlfiles(variable.xmlfiles)}'
|
||||||
warn(warning)
|
warn(warning,
|
||||||
|
DeprecationWarning,
|
||||||
|
)
|
||||||
self.objectspace.informations.add(
|
self.objectspace.informations.add(
|
||||||
variable.path, "ymlfiles", variable.xmlfiles
|
variable.path, "ymlfiles", variable.xmlfiles
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -585,7 +585,10 @@ class ParserVariable:
|
||||||
del family["variable"]
|
del family["variable"]
|
||||||
if self.version != "1.0":
|
if self.version != "1.0":
|
||||||
warning = f'"variable" attribute in dynamic family "{ path }" is depreciated in {filename}'
|
warning = f'"variable" attribute in dynamic family "{ path }" is depreciated in {filename}'
|
||||||
warn(warning)
|
warn(warning,
|
||||||
|
DeprecationWarning,
|
||||||
|
stacklevel=2,
|
||||||
|
)
|
||||||
if "variable" in family:
|
if "variable" in family:
|
||||||
raise Exception(
|
raise Exception(
|
||||||
f'dynamic family must not have "variable" attribute for "{family["path"]}" in {family["xmlfiles"]}'
|
f'dynamic family must not have "variable" attribute for "{family["path"]}" in {family["xmlfiles"]}'
|
||||||
|
|
|
||||||
|
|
@ -307,7 +307,10 @@ class JinjaCalculation(Calculation):
|
||||||
objectspace.jinja[jinja_path] = self.jinja
|
objectspace.jinja[jinja_path] = self.jinja
|
||||||
if return_type in RENAME_TYPE:
|
if return_type in RENAME_TYPE:
|
||||||
warning = f'the variable "{ self.path }" has a depreciated return_type "{return_type}", please use "{RENAME_TYPE[return_type]}" instead in {display_xmlfiles(variable.xmlfiles)}'
|
warning = f'the variable "{ self.path }" has a depreciated return_type "{return_type}", please use "{RENAME_TYPE[return_type]}" instead in {display_xmlfiles(variable.xmlfiles)}'
|
||||||
warn(warning)
|
warn(warning,
|
||||||
|
DeprecationWarning,
|
||||||
|
stacklevel=2,
|
||||||
|
)
|
||||||
return_type = RENAME_TYPE[return_type]
|
return_type = RENAME_TYPE[return_type]
|
||||||
default = {
|
default = {
|
||||||
"function": function,
|
"function": function,
|
||||||
|
|
|
||||||
|
|
@ -75,6 +75,10 @@ class ExtentionError(Exception):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
class RougailWarning(UserWarning):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
## ---- specific exceptions ----
|
## ---- specific exceptions ----
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue