Compare commits

...

64 Commits

Author SHA1 Message Date
4810a8d683 Merge branch 'develop' into dist/risotto/risotto-2.8.0/develop 2021-05-16 06:53:48 +02:00
21bee4715a new function zone_information returns a list 2021-05-16 06:53:40 +02:00
533c70aef2 Merge branch 'develop' into dist/risotto/risotto-2.8.0/develop 2021-05-14 07:01:16 +02:00
4711206c55 allow any character as service name 2021-05-14 07:00:55 +02:00
ef83c3d257 Merge branch 'develop' into dist/risotto/risotto-2.8.0/develop 2021-05-13 22:32:39 +02:00
9c1589ca53 better systemd service support 2021-05-13 22:30:58 +02:00
20f329d433 remove_choice only avalable for choice 2021-05-06 07:06:42 +02:00
8d32ec9f01 better choice documentation 2021-05-05 15:27:06 +02:00
b35d930d7e valid_enum is now choice 2021-05-01 18:32:45 +02:00
d7a1a52ebb Merge pull request 'disabled a service (ref #4)' (#5) from fix/disabled_service into develop
Reviewed-on: #5
2021-05-01 18:13:10 +02:00
d3008dc217 disabled a service (ref #4) 2021-04-29 18:20:05 +02:00
254a861472 Merge branch 'develop' into dist/risotto/risotto-2.8.0/develop 2021-04-26 17:56:50 +02:00
a87485abd2 default value for ParamInformation must be empty list for multi value 2021-04-26 17:56:41 +02:00
84eafb2deb Merge branch 'develop' into dist/risotto/risotto-2.8.0/develop 2021-04-16 09:32:49 +02:00
0e55679e8b cannot override an existing dictionary in upgrade 2021-04-16 09:20:54 +02:00
12111397e6 leadership in dynamic family + path of leadership in extra 2021-04-16 09:20:18 +02:00
36827b6869 Merge branch 'develop' into dist/risotto/risotto-2.8.0/develop 2021-04-14 18:00:46 +02:00
e354352dc8 simplify group 2021-04-14 17:55:40 +02:00
a0fd998aeb Merge branch 'develop' into dist/risotto/risotto-2.8.0/develop 2021-04-13 20:00:46 +02:00
e5737cd572 remove group constrainte, it's now a normal group 2021-04-13 19:05:01 +02:00
65d40f494f reident tests 2021-04-13 11:07:10 +02:00
4fd5d38ca0 Merge branch 'develop' into dist/risotto/risotto-2.8.0/develop 2021-04-12 16:58:05 +02:00
cda68e88a2 fake files 2021-04-12 16:57:57 +02:00
278fdd339a Merge branch 'develop' into dist/risotto/risotto-2.8.0/develop 2021-04-12 15:04:48 +02:00
f4471c4875 can add extra annotators 2021-04-12 15:04:38 +02:00
b7cedd85fb support leadership name in extra 2021-04-12 15:04:15 +02:00
3999969aa0 In creole template support of %%lead.follower2 and %%lead['follower2'] notation
%if 'follower1' in %%lead now search if a follower exists has follower
2021-04-04 19:46:05 +02:00
1249276b9d now we can personalise default setting for file et override 2021-04-04 11:03:49 +02:00
0970eee14e Merge branch 'develop' into dist/risotto/risotto-2.8.0/develop 2021-03-28 15:49:59 +02:00
5add91082f auto_freeze_variable cannot be force_default_on_freeze 2021-03-28 15:49:40 +02:00
e9596c2e2a Merge branch 'develop' into dist/risotto/risotto-2.8.0/develop 2021-03-27 15:42:06 +01:00
1c7e2b9f0b rougail/template is a module 2021-03-27 15:41:59 +01:00
42b67ce575 Merge branch 'develop' into dist/risotto/risotto-2.8.0/develop 2021-03-27 11:08:19 +01:00
17e7f4caa0 update improvment 2021-03-27 07:45:45 +01:00
2a77093187 param with tiramisu3 library 2021-03-27 07:45:11 +01:00
db69df3b86 external function support in fill 2021-03-27 07:44:42 +01:00
2b2cc4cf20 name in family or variable must be valid 2021-03-27 07:44:13 +01:00
20de4443ae do not generate empty file 2021-03-19 10:32:08 +01:00
1e6c9060b5 better debug information 2021-03-19 10:31:29 +01:00
e66a462710 add creole_client and is_empty in creole_legacy 2021-03-19 10:31:05 +01:00
9eb6a67ac6 manage fill with multi variable 2021-03-19 10:16:06 +01:00
d895c46729 auto_freeze is now allowed in extra 2021-03-19 10:15:34 +01:00
63e679036b add valid_enum with function and rename domain type to domainname 2021-03-19 10:14:08 +01:00
12acf2a3f4 update tests 2021-03-19 10:05:50 +01:00
fc686e9b7f if name is a variable, it could be disabled 2021-03-08 17:56:28 +01:00
6a12504e8c remove variable in param and remove check 2021-03-08 06:52:49 +01:00
e11105db32 calculation with param 'information' from a variable 2021-03-08 06:52:01 +01:00
7eb78e5346 Merge branch 'develop' into dist/risotto/risotto-2.8.0/develop 2020-11-21 08:11:39 +01:00
11553e6f09 Merge branch 'develop' into dist/risotto/risotto-2.8.0/develop 2020-11-20 18:02:55 +01:00
0722e76fcc Merge branch 'develop' into dist/risotto/risotto-2.8.0/develop 2020-11-18 22:18:54 +01:00
adaafde2e5 Merge branch 'develop' into dist/risotto/risotto-2.8.0/develop 2020-11-15 11:22:19 +01:00
19d9fdc705 Merge branch 'develop' into dist/risotto/risotto-2.8.0/develop 2020-11-15 11:02:10 +01:00
11294fdd61 Merge branch 'develop' into dist/risotto/risotto-2.8.0/develop 2020-11-14 17:21:05 +01:00
4351662f2e Merge branch 'develop' into dist/risotto/risotto-2.8.0/develop 2020-11-14 08:02:45 +01:00
5bf8d69e91 Merge branch 'develop' into dist/risotto/risotto-2.8.0/develop 2020-11-08 18:06:45 +01:00
a9c74d68ff Merge branch 'develop' into dist/risotto/risotto-2.8.0/develop 2020-10-14 18:17:45 +02:00
48d190d39b update dependencies 2020-08-12 12:22:19 +02:00
f474edd8ae rougail => python3-rougail 2020-08-12 11:14:02 +02:00
61fc9b15e5 ajout de la dependance vers cheetah 2020-08-12 08:41:54 +02:00
79312cc8c8 Merge branch 'develop' into dist/risotto/risotto-2.7.1/develop 2020-08-12 08:37:12 +02:00
0da8b868ac Merge branch 'develop' into dist/risotto/risotto-2.7.1/develop 2020-08-07 17:18:01 +02:00
a2e8b5dad4 Merge branch 'develop' into dist/risotto/risotto-2.7.1/develop 2020-08-05 10:33:54 +02:00
58b3880e9b Delete changelog 2020-07-29 09:56:15 +02:00
413ab6dbb0 Add debian folder in packaging branch 2020-07-29 09:55:51 +02:00
2847 changed files with 33104 additions and 12973 deletions

662
debian/agpl-3 vendored Normal file
View File

@ -0,0 +1,662 @@
GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU Affero General Public License is a free, copyleft license for
software and other kinds of works, specifically designed to ensure
cooperation with the community in the case of network server software.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
our General Public Licenses are intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
Developers that use our General Public Licenses protect your rights
with two steps: (1) assert copyright on the software, and (2) offer
you this License which gives you legal permission to copy, distribute
and/or modify the software.
A secondary benefit of defending all users' freedom is that
improvements made in alternate versions of the program, if they
receive widespread use, become available for other developers to
incorporate. Many developers of free software are heartened and
encouraged by the resulting cooperation. However, in the case of
software used on network servers, this result may fail to come about.
The GNU General Public License permits making a modified version and
letting the public access it on a server without ever releasing its
source code to the public.
The GNU Affero General Public License is designed specifically to
ensure that, in such cases, the modified source code becomes available
to the community. It requires the operator of a network server to
provide the source code of the modified version running there to the
users of that server. Therefore, public use of a modified version, on
a publicly accessible server, gives the public access to the source
code of the modified version.
An older license, called the Affero General Public License and
published by Affero, was designed to accomplish similar goals. This is
a different license, not a version of the Affero GPL, but Affero has
released a new version of the Affero GPL which permits relicensing under
this license.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU Affero General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Remote Network Interaction; Use with the GNU General Public License.
Notwithstanding any other provision of this License, if you modify the
Program, your modified version must prominently offer all users
interacting with it remotely through a computer network (if your version
supports such interaction) an opportunity to receive the Corresponding
Source of your version by providing access to the Corresponding Source
from a network server at no charge, through some standard or customary
means of facilitating copying of software. This Corresponding Source
shall include the Corresponding Source for any work covered by version 3
of the GNU General Public License that is incorporated pursuant to the
following paragraph.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the work with which it is combined will remain governed by version
3 of the GNU General Public License.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU Affero General Public License from time to time. Such new versions
will be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU Affero General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU Affero General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU Affero General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If your software can interact with users remotely through a computer
network, you should also make sure that it provides a way for users to
get its source. For example, if your program is a web application, its
interface could display a "Source" link that leads users to an archive
of the code. There are many ways you could offer source, and different
solutions will be better for different programs; see section 13 for the
specific requirements.
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU AGPL, see
<https://www.gnu.org/licenses/>.

1
debian/compat vendored Normal file
View File

@ -0,0 +1 @@
11

14
debian/control vendored Normal file
View File

@ -0,0 +1,14 @@
Source: rougail
Section: admin
Priority: extra
Maintainer: Cadoles <contact@cadoles.com>
Build-depends: debhelper (>=11), python3-all, python3-setuptools, dh-python
Standards-Version: 3.9.4
Homepage: https://forge.cadoles.com/Infra/rougail
Package: python3-rougail
Architecture: any
Pre-Depends: dpkg, python3, ${misc:Pre-Depends}
Depends: ${python:Depends}, ${misc:Depends}, python3-cheetah, python3-tiramisu3
Description: configuration manager

22
debian/copyright vendored Normal file
View File

@ -0,0 +1,22 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: risotto
Upstream-Contact: Cadoles <contact@cadoles.com>
Source: https://forge.cadoles.com/Infra/rougail
Files: *
Copyright: 2019-2020 Cadoles <contact@cadoles.com>
License: AGPL-3+
License: AGPL-3+
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.

3
debian/rougail.dirs vendored Normal file
View File

@ -0,0 +1,3 @@
/var/rougail/patches
/var/rougail/templates
/var/rougail/manifests

10
debian/rules vendored Normal file
View File

@ -0,0 +1,10 @@
#!/usr/bin/make -f
# See debhelper(7) (uncomment to enable)
# output every command that modifies files on the build system.
#DH_VERBOSE = 1
export PYBUILD_NAME = rougail
export PYBUILD_DISABLE_python3 = test
%:
dh $@ --with python3 --buildsystem=pybuild

1
debian/source/format vendored Normal file
View File

@ -0,0 +1 @@
3.0 (quilt)

View File

@ -28,7 +28,6 @@ Rougail est un bibliothèque python3 qui permet de charger des dictionnaires (fi
- [Les calcules automatiques](fill/README.md)
- [Les vérifications des valeurs](check/README.md)
- [Les conditions](condition/README.md)
- [Les variables meneuses ou suiveuses](variable/leadership.md)
## Les templates

View File

@ -1,5 +1,4 @@
# Les vérifications des valeurs
- [Fonction de vérification](function.md)
- [Les variables à choix](valid_enum.md)
- [Réfinition](redefine.md)

View File

@ -1,46 +0,0 @@
# Les variables à choix
Une variable à choix est d'abord une variable avec une [fonction check](function.md).
## Les variables à choix simple
Il est possible d'imposer une liste de valeur pour une variable particulière :
```
<check name="valid_enum">
<param>yes</param>
<param>no</param>
<param>maybe</param>
<target>my_variable</target>
</check>
```
Dans ce cas, seule les valeurs proposés sont possible pour cette variable.
Par défaut, cette variable est obligatoire. Cela signifie qu'il n'est pas possible de spécifier "None" à cette variable.
## Les variables à choix avec valeur None
Il y a deux possibilités pour avoir une valeur "None" dans les choix :
- rendre la variable non obligatoire, cela va ajouter un choix "None" dans la liste :
```
<variable name="my_variable" mandatory="False">
```
Ou en ajoutant le paramètre "None" :
```
<check name="valid_enum">
<param>yes</param>
<param>no</param>
<param type='nil'/>
<param>maybe</param>
<target>my_variable</target>
</check>
```
## La valeur par défaut
Si aucune valeur n'est spécifié pour la variable, automatiquement le premier choix va est placé comme valeur par défaut.

View File

@ -14,7 +14,9 @@ Pour modifier il suffit de faire :
RougailConfig[key] = value
```
## Les répertoires des dictionnaires
## Configuration de chargement des dictionnaires
### Les répertoires des dictionnaires
Il existe deux types de répertoires de dictionnaires :
@ -36,7 +38,7 @@ RougailConfig['extra_dictionaries']['example'] = ['/dir1', '/dir2']
Les dictionnaires sont chargés dans le même ordre que les dictionnaires principaux.
## La DTD
### La DTD
Rougail a besoin du fichier de DTD pour lire les fichiers dictionnaire.
@ -44,51 +46,75 @@ Par défaut le fichier de la DTD est dans le sous répertoire "data" du réperto
Pour pouvez changer le répertoire de destination de la DTD et le nom du fichier avec la clef "dtdfilename".
## Le fichier de fonction
### Le fichier de fonction
Le fichier qui contient les fonctions personnalisés est géré dans la clef "functions_file" et a comme valeur par défaut "/srv/rougail/functions.py".
## Le répertoire des templates
Le répertoire des templates est géré dans la clef "templates_dir" et a comme valeur par défaut : "/srv/rougail/templates".
## Le moteur de templates par défaut
Le moteur de template est géré dans la clef "default_engine" et a comme valeur par défaut : "creole". Les valeurs possible sont "none", "creole" ou "jinja2".
## Le répertoire des patchs
Le répertoire des patches est géré dans la clef "patches_dir" et a comme valeur par défaut : "/srv/rougail/patches".
## Le répertoire temporaire
Le répertoire temporaire est utile lors de la génération de template. Il contient une copie des templates avec, éventuellement, les patches appliqués sur les templates.
Le répertoire de temporaire est géré dans la clef "tmp_dir" et a comme valeur par défaut : "/srv/rougail/tmp".
## Le répertoire de destination des fichiers générés
Le répertoire de destination des fichiers générés est géré dans la clef "destinations_dir" et a comme valeur par défaut : "/srv/rougail/destinations".
## La variable auto_freeze
### La variable auto_freeze
La propriété auto_freeze n'est appliqué que une variable spécifique passe à True. Par défaut le nom de la variable est "instancied_module", mais il est possible de changer le nom de cette variable via la clef "auto_freeze_variable".
## Les modes
### Les modes
Les modes sont personnalisables dans Rougail. Par défaut les modes sont "basic", "normal" et "expert".
Il est possible de changer cette liste via la clef "modes_level".
Si vous changer ces valeurs, penser à changer les modes par défaut des familles et des variables.
## Le mode par défaut pour une famille
### Le mode par défaut pour une famille
Le mode par défaut d'une famille est "basic". Il est possible de changer le mode par défaut d'une famille via la clef "default_family_mode".
## Le mode par défaut pour une variable
### Le mode par défaut pour une variable
Le mode par défaut d'une variable est "normal". Il est possible de changer le mode par défaut d'une variable via la clef "default_variable_mode".
## Le nom des fonctions internes
### Le nom des fonctions internes
Il est possible d'ajouter des fonctions interne via la clef "internal_functions".
## Configuration de la templatisation
### Le répertoire des templates
Le répertoire des templates est géré dans la clef "templates_dir" et a comme valeur par défaut : "/srv/rougail/templates".
### Le répertoire des patchs
Le répertoire des patches est géré dans la clef "patches_dir" et a comme valeur par défaut : "/srv/rougail/patches".
### Le répertoire temporaire
Le répertoire temporaire est utile lors de la génération de template. Il contient une copie des templates avec, éventuellement, les patches appliqués sur les templates.
Le répertoire de temporaire est géré dans la clef "tmp_dir" et a comme valeur par défaut : "/srv/rougail/tmp".
### Le répertoire de destination des fichiers générés
Le répertoire de destination des fichiers générés est géré dans la clef "destinations_dir" et a comme valeur par défaut : "/srv/rougail/destinations".
## La configuration par défaut des fichiers
### Le moteur de templates par défaut
Le moteur de template est géré dans la clef "default_files_engine" et a comme valeur par défaut : "creole". Les valeurs possible sont "none", "creole" ou "jinja2".
### Les droits par défaut des fichiers
Les droits des fichiers générés est géré dans la clef "default_files_mode" et a comme valeur par défaut : "0644".
### Le propriétaire par défaut des fichiers
Le propriétaire des fichiers générés est géré dans la clef "default_files_owner" et a comme valeur par défaut : "root".
Le groupe propriétaire des fichiers générés est géré dans la clef "default_files_group" et a comme valeur par défaut : "root".
### La méthode d'inclusion par défaut des fichiers
La méthode d'inclusion des fichiers générés est géré dans la clef "default_files_included" et a comme valeur par défaut : "no". Les valeurs possible sont "no", "name" et "content".
'default_files_included': 'no',
## La configuration par défaut des overrides
### Le moteur de templates par défaut
Le moteur de template est géré dans la clef "default_overrides_engine" et a comme valeur par défaut : "creole". Les valeurs possible sont "none", "creole" ou "jinja2".

View File

@ -2,4 +2,5 @@
- [Une famille](simple.md)
- [Famille crée dynamiquement](auto.md)
- [Les variables meneuses ou suiveuses](leadership.md)

56
doc/family/leadership.md Normal file
View File

@ -0,0 +1,56 @@
# Variable meneuse ou suiveuse
## Variable meneuse
Une variable meneuse est une variable qui va guider la longueur d'autre variables (appelé variables suiveuse).
Une variable meneuse est une [variable](../variable/README.md) qui est obligatoirement de type multiple.
Une variable meneuse peut être obligatoire.
Le [mode](../mode.md) par défaut correspond au plus petit mode définit par l'utilisateur des variables suiveuses.
## Variable suiveuse
Une variable suiveuse est une variable donc la longueur n'est pas déterminé par elle-même, mais est identique à celle de la variable meneuse dont elle dépend.
Une variable suiveuse est une variable placer juste derrière une variable meneuse ou une autre variable suiveuse.
L'ordre de définition des variables suiveuses est important.
Cette variable peut être de type multiple. Dans ce cas, pour un index determiné, il est possible de mettre plusieurs valeurs à une même variable.
Une variable suiveuse peut être obligatoire. Cela signifie que lorsqu'une variable meneuse est renseigné, il faut obligatoirement que la variable suiveuse est également une valeur à l'index considéré.
Si aucune valeur n'est définit pour la variable meneuse, aucune valeur n'est a spécifié pour la variable suiveuse.
Le [mode](../mode.md) par défaut d'une variable suiveuse correspond au [mode](../mode.md) de la variable meneuse.
Si une variable meneuse est caché ou désactivé, les variables suiveuses le seront également.
## Définition des variables meneuse et suiveuse
Les variables meneuses et suiveuses doivent dans une famille de type "leadership".
Voici un exemple de définition d'une variable meneuse et de deux variables meneuses :
```
<variables>
<family name="family" leadership='True'>
<variable name="leader" multi='True'/>
<variable name="follower1"/>
<variable name="follower2" multi='True'/>
</family>
</variables>
```
## Ajout d'une nouvelle variable suiveuse
Pour ajouter, dans un nouveau dictionnaire, une variable suiveuse à notre groupe, rien de plus simple, il suffit définir une ou des nouvelles variables dans la famille :
```
<variables>
<family name="family">
<variable name="follower3"/>
</family>
</variables>
```

View File

@ -49,8 +49,8 @@ Si une condition "hidden_if_in" est spécifié à la variable, la valeur sera mo
## Variable meneuse ou suiveuse avec valeur calculé
Une [variable suiveuse](../variable/leadership.md) ne peut pas être calculé automatiquement.
Une [variable meneuse](../variable/leadership.md) peut être calculé automatiquement.
Une [variable suiveuse](../family/leadership.md) ne peut pas être calculé automatiquement.
Une [variable meneuse](../family/leadership.md) peut être calculé automatiquement.
Si la variable n'est pas multiple, il ne faut pas que le calcule retourne une liste.
## Variable dynamique avec une valeur calculée

View File

@ -1,6 +1,8 @@
# Paramètre de type information
Le paramètre peut être la valeur est issue d'une information de la configuration.
## Les informations de la configuration
Le paramètre peut être la valeur est issue d'une information de la configuration :
```
<param type="information">server_name</param>
@ -8,3 +10,15 @@ Le paramètre peut être la valeur est issue d'une information de la configurati
Dans ce cas, l'information de la configuration "server_name" sera utilisé comme valeur du paramètre.
Si l'information n'existe pas, la paramètre aura la valeur "None".
## Les informations de la cible
Le paramètre peut être la valeur est issue d'une information de la cible du calcul :
```
<param type="target_information">test</param>
<param type="target_information">help</param>
```
Dans ce cas, l'information de la configuration "test" ou "help" sera utilisé comme valeur du paramètre.
Si l'information n'existe pas, la paramètre aura la valeur "None".

View File

@ -6,7 +6,7 @@ Imaginons que la variable "my_variable" pré-existe. La valeur de la variable se
<param type="variable">my_variable</param>
```
[Les variables meneuses ou suiveuses](../variable/leadership.md) peuvent être utilisé sans soucis comme paramètre.
[Les variables meneuses ou suiveuses](../family/leadership.md) peuvent être utilisé sans soucis comme paramètre.
## Paramètre avec variable potentiellement non existante

View File

@ -97,12 +97,14 @@ Attention : les deux variables "my_variable1" et "my_variable2" doivent être mu
Par défaut les droits du fichier généré sont "0644" avec comme utilisateur "root" et groupe "root".
Il est possible de définir une autre valeur à un ou plusieurs de ces attributs :
Il est possible de définir les droits, l'utilisateur ou le groupe d'un fichier généré :
```
<file mode="0640" owner="nobody" group="squid">/etc/squid/squid.conf</file>
```
Il est possible de personnaliser les droits par défaut dans la [configuration de rougail](../dev/config.md)
## Désactiver la génération d'un fichier
Il est possible de définir une [condition](../condition/README.md) de type "disabled_if_in" ou "disabled_if_not_in" sur une balise fichier :
@ -150,6 +152,8 @@ Ou d'utiliser le moteur "jinja2" :
<file engine="jinja2">/etc/squid/squid.conf</file>
```
Il est possible de personnaliser le moteur par défaut dans la [configuration de rougail](../dev/config.md)
## Inclusion de template
Un attribut "included" permet de définir la nature du fichier. Cet attribut peut avoir trois valeurs :
@ -166,3 +170,5 @@ Exemples :
```
Bien entendu, c'est au développeur de lister ou d'inclure le contenu de ce template dans le fichier de destination. Cet attribut permet juste de garantir que le fichier sera fait avant l'autre et de ne pas l'installer sur le serveur si ce n'est pas nécessaire.
Il est possible de personnaliser les methodes d'inclusion par défaut dans la [configuration de rougail](../dev/config.md)

View File

@ -41,3 +41,5 @@ Ou d'utiliser le moteur "jinja2" :
```
<override engine="jinja2"/>
```
Il est possible de personnaliser le moteur par défaut dans la [configuration de rougail](../dev/config.md)

View File

@ -29,6 +29,16 @@ Un service non géré ne peut conteneur que des fichiers.
## Désactiver la génération d'un service
Il est possible de désactiver un service. Pour cela il faut rajouter l'attribut "disabled" à True :
```
<services>
<service name="test" disabled="True"/>
</services>
```
Dans ce cas, tous les services et les éléments qu'il compose ([fichier](file.md), ...) seront désactivés.
Il est possible de définir une [condition](../condition/README.md) de type "disabled_if_in" ou "disabled_if_not_in" sur une balise service :
```

View File

@ -1,4 +1,254 @@
# Variable
- [Une variable](simple.md)
- [Variable meneuse ou suiveuse](leadership.md)
## Un variable
Une variable est forcement dans [variables](../variables.md) ou dans une [famille](../family/README.md).
Une variable est déjà un nom. C'est à dire qu'on pourra utiliser plus tard la variable via ce nom.
```
<variables>
<variable name="my_variable"/>
<family name="my_family">
<variable name="my_family_variable"/>
</variable>
</variables>
```
## Description et aide sur la variable
En plus d'un nom, il est possible de mettre une "description" à la variable. C'est une information "utilisateur" qui nous permettra d'avoir des informations complémentaires sur le contenu de cette variable :
```
<variable name="my_variable" description="This is a greate variable"/>
```
En plus de la description, il est possible de préciser une aide complémentaire :
```
<variable name="my_variable" help="This is a greate variable"/>
```
Cette aide peut être utilisé à tout moment comme valeur [d'un paramètre](../param/information.md).
## Le type de la variable
Une variable a un type. Ce type permet de définir les valeurs acceptées par cette variable :
- string : chaine de caractère (type par défaut)
- number : un nombre
- float : un chiffre flottant
- boolean : "True" ou "False", si aucune valeur n'est défini la valeur par défaut de cette variable sera "True", ces variables sont également obligatoire par défaut
- password : un mot de passe
- mail : une adresse mail
- filename : nom de fichier au sens Unix (exemple : "/etc/passwd")
- date : une date au format "%Y-%m-%d" (exemple : "2021-01-30")
- unix_user : nom d'utilisateur au sens Unix
- ip : n'importe quelle adresse IPv4
- cidr : n'importe quelle adresse IPv4 au format CIDR
- local_ip : adresse IPv4 sur un réseau local, si l'adresse IPv4 n'est pas local, un warning sera afficher mais la valeur sera accepté tout de même
- netmask : masque d'une adresse IPv4
- network : adresse réseau
- network_cidr : adresse réseau au format CIDR
- broadcast : adresse de diffusion
- netbios : nom netbios
- domain : nom de domaine
- hostname : nom d'hôte
- web_address : adresse web (http://www.cadoles.com/)
- port : port
- mac : adresse MAC
- schedule : périodicité du schedule, les valeurs possibles sont "none", "daily", "weekly" ou "monthly"
- schedulemod : type de schedule, les valeurs possibles sont "pre" ou "post"
Pour définir le type d'une variable :
```
<variable name="my_variable" type="number"/>
```
## Variable à valeur multiple
Par défaut une variable ne peut acceuillir qu'une seule valeur. Il peut être utile de pouvoir spécifier plusieurs valeurs à une même variable.
Pour définir une variable à valeur multiple :
```
<variable name="my_variable" multi="True"/>
```
## Variable invisible
Il est possible de cacher une variable.
Cacher une variable signifie qu'elle ne sera pas visible lorsqu'on modifie la configuration du service.
Par contre cette variable sera accessibles lorsqu'on va l'utiliser.
Pour cacher une variable :
```
<variable name="my_variable" hidden="True"/>
```
## Variable désactive
Il est possible de désactiver une variable.
Désactiver une variable signifie qu'elle ne sera pas visible lorsqu'on modifie la configuration du service mais également lorsqu'on va l'utiliser.
Pour désactiver une variable :
```
<variable name="my_variable" disabled="True"/>
```
## Variable obligatoire
Variable dont une valeur est requise :
```
<variable name="my_variable" mandatory="True"/>
```
Les variables booléans sont par défaut obligatoire. Pour qu'une variable booléan ne soit pas obligatoire il faut le préciser explicitement :
```
<variable name="my_variable" type="boolean" mandatory="False"/>
```
Les variables avec une valeur par défaut (non calculée) sont également automatiquement obligatoire.
## Valeur par défaut d'une variable
Il est possible de fixer les valeurs par défaut d'une variable :
```
<variable name="my_variable">
<value>value</value>
</variable>
```
Pour une variable multiple, il est possible de préciser plusieurs valeurs :
```
<variable name="my_variable" multi="True">
<value>value 1</value>
<value>value 2</value>
</variable>
```
Si la variable n'est pas pas une [variable meneuse](../family/leadership.md), la première valeur défini dans cette liste sera également la valeur par défaut proposé si on ajoute une nouvelle valeur à cette variable.
Une valeur par défaut peut également être [une valeur calculer](../fill/README.md).
## Redéfinir une variable
Il est possible de définir une variable dans un dictionnaire et de changer son comportement dans une second dictionnaire.
Attention trois attributs ne sont redéfinisable :
- name
- type
- multi
Créons notre variable :
<variable name="my_variable"/>
Et redéfinisons là :
```
<variable name="my_variable" redefine="True" description="New description"/>
```
## Créer une variable inexistante
Il est parfois utile de créer une variable si elle n'existe pas dans un autre dictionnaire :
```
<variable name="my_variable" exists="False"/>
```
Si cette variable existe dans un autre dictionnaire, elle ne sera pas modifié ni recréé
## Redéfinir une variable si elle existe
Parfois on veut pouvoir redéfinir une variable mais seulement dans le cas où elle existe déjà :
```
<variable name="my_variable" redefine="True" exists="True" hidden="True"/>
```
## Variable à valeur automatiquement modifiée
Une variable avec valeur automatiquement modifiée est une variable dont la valeur sera considéré comme modifié quand la propriété global "force_store_value" de Tiramisu est mise.
Voici une variable a valeur automatiquement modifiée :
```
<variable name="my_variable" auto_save="True">
<value>my_value</value>
</variable>
```
Dans ce cas la valeur est fixée à la valeur actuelle.
Par exemple, si la valeur de cette variable est issue d'un calcul, la valeur ne sera plus recalculée.
Ces variables sont généralement des variables obligatoires. En effet ces variable ne sont automatiquement modifiées que si elles ont une valeurs.
Une [variable meneuse ou suiveuse](../family/leadership.md) ne peut pas avoir la propriété auto_save.
## Variable à valeur en lecture seule automatique
Une variable avec valeur en lecture seule automatique est une variable dont la valeur ne sera plus modifiable par l'utilisateur quand la [variable "server_deployed" passe à "True"](../dev/config.md).
Voici un variable à valeur en lecture seule automatique :
```
<variable name="server_deployed" type="boolean">
<value>False</value>
</variable>
<variable name="my_variable" auto_freeze="True"/>
```
Dans ce cas la valeur est fixée à la valeur actuelle et elle ne sera plus modifiable par l'utilisateur.
Par exemple, si la valeur de cette variable est issue d'un calcul, la valeur ne sera plus recalculée.
Ces variables sont généralement des variables obligatoires. En effet ces variable ne sont en lecteur seul que si elles ont une valeurs.
Une [variable meneuse ou suiveuse](../family/leadership.md) ne peut pas avoir la propriété auto_freeze.
## Information "test"
L'attribut "test" est un attribut spécial qui permet aux concepteurs d'un dictionnaire d'influancer le robot de test en précisant de valeurs utile à tester.
Concrêtement, le contenu de cet attribut est enregister dans une "information" de l'option Tiramisu correspondante.
Exemple :
```
<variable name="my_variable" test="yes"/>
```
Il est possible de préciser plusieurs valeurs avec le séparateur "|" :
```
<variable name="my_variable" test="yes|no"/>
```
Cette valeur peut être utilisé à tout moment comme valeur [d'un paramètre](../param/information.md).
## Mode de la variable
Le [mode](../mode.md) par défaut d'une variable correspond au [mode](../mode.md) de la [famille](../family/README.md).
Cas particuliers :
- une variable à valeur automatiquement modifiée ou une variable en lecture seule automatique est par défaut en mode "basic".
- si la variable n'est pas dans une famille, la variable aura le mode "normal" par défaut.
- une variable obligatoire sans valeur par défaut (calculer ou non) aura le mode "basic".
Pour définir le [mode](../mode.md) :
```
<variable name="my_variable" mode="expert"/>
```

91
doc/variable/choice.md Normal file
View File

@ -0,0 +1,91 @@
# Les variables à choix
## Une variable à choix
Il est possible d'imposer une liste de valeur pour une variable particulière :
```
<variable name="my_variable" type="choice">
<choice>val1</choice>
<choice>val2</choice>
<choice>val3</choice>
</variable>
```
Dans ce cas, seules les valeurs proposées sont possibles pour cette variable.
Cette variable n'est pas obligatoire dont il est possible de mettre la valeur "None".
Si la variable est obligatoire ou si une valeur est précisée (la variable passe obligatoire) alors la valeur "None" n'est plus autorisé :
```
<variable name="my_variable" type="choice">
<choice>val1</choice>
<choice>val2</choice>
<choice>val3</choice>
<value>val1</value>
</variable>
```
## Un variable à choix typée
Par défaut les choix sont de type "string". Il est possible de préciser des nombres, des booléens ou la valeur None :
```
<variable name="my_variable" type="choice">
<choice>val1</choice>
<choice type="string">val2</choice>
<choice type="number">3</choice>
<choice type="boolean">True</choice>
<choice type="nil"/>
</variable>
```
Comme vu précédement ajouter la valeur None n'est pas utile parce qu'elle est automatiquement ajouté si la variable n'est pas obligatoire.
## Ajouter une option à une variable à choix existante
Pour ajouter un choix à une variable à choix existante, rien de plus simple, juste redéfinir la variable en ajoutant le choix voulu :
```
<variable name="my_variable" redefine="True">
<choice>val4</choice>
</variable>
```
## Redéfinir une option à choix
Si on veut supprimer un choix ou redéfinir complètement la liste, il faut redéfinir cette variable et ajouter l'attribut "remove_choice" à "True" :
```
<variable name="my_variable" redefine="True" remove_choice="True">
<choice>val1</choice>
<choice>val2</choice>
</variable>
```
Dans ce cas toutes les anciens choix ne seront plus possible. Seuls les nouveaux le seront.
## Un variable à choix provenant d'une variable
Une variable à valeur multiple peut servir de source des choix :
```
<variable name="my_variable" type="choice">
<choice type="variable">other_variable</choice>
</variable>
```
Dans ce cas, toutes les valeurs de la variable seront des choix utilisables par l'utilisateur.
Seul un choice de type "variable" est possible par variable.
## Un variable à choix provenant d'une fonction
```
<variable name="my_variable" type="choice">
<choice type="function" name="trange">
<param type="number">0</param>
<param type="number">10</param>
</choice>
<value type="number">9</value>
</variable>
```

View File

@ -74,15 +74,15 @@ Voici un exemple de définition d'une variable meneuse et de deux variables mene
</variables>
<constraints>
<group leader="example.family.leader">
<follower>example.family.follower1</follower>
<follower>example.family.follower2</follower>
<follower>follower1</follower>
<follower>follower2</follower>
</group>
</constraints>
```
Le chemin de la variable meneuse est traditionnel, par contre le chemin des variables suiveuses n'est pas le chemin définitif de la variable.
Le chemin de la variable meneuse est traditionnel, par contre le chemin des variables suiveuses est le chemin relatif de la variable.
Le chemin d'une variable suiveuse est normalement "example.family.leader.follower1" mais la variable n'est pas encore une variable suiveuse à ce moment là du traitement. C'est pour cela qu'il ne faut, uniquement dans les groupes, mettre le nom de la variable meneuse dans le chemin.
Le chemin d'une variable suiveuse est normalement "example.family.leader.follower1" mais la variable n'est pas encore une variable suiveuse à ce moment là du traitement. C'est pour cela qu'il ne faut, uniquement dans les groupes, mettre le nom de la variable suiveuse.
## Ajout d'une nouvelle variable suiveuse

View File

@ -1,251 +0,0 @@
# Variable
## Un variable
Une variable est forcement dans [variables](../variables.md) ou dans une [famille](../family/README.md).
Une variable est déjà un nom. C'est à dire qu'on pourra utiliser plus tard la variable via ce nom.
```
<variables>
<variable name="my_variable"/>
<family name="my_family">
<variable name="my_family_variable"/>
</variable>
</variables>
```
## Description et aide sur la variable
En plus d'un nom, il est possible de mettre une "description" à la variable. C'est une information "utilisateur" qui nous permettra d'avoir des informations complémentaires sur le contenu de cette variable :
```
<variable name="my_variable" description="This is a greate variable"/>
```
En plus de la description, il est possible de préciser une aide complémentaire :
```
<variable name="my_variable" help="This is a greate variable"/>
```
## Le type de la variable
Une variable a un type. Ce type permet de définir les valeurs acceptées par cette variable :
- string : chaine de caractère (type par défaut)
- number : un nombre
- float : un chiffre flottant
- boolean : "True" ou "False", si aucune valeur n'est défini la valeur par défaut de cette variable sera "True", ces variables sont également obligatoire par défaut
- password : un mot de passe
- mail : une adresse mail
- filename : nom de fichier au sens Unix (exemple : "/etc/passwd")
- date : une date au format "%Y-%m-%d" (exemple : "2021-01-30")
- unix_user : nom d'utilisateur au sens Unix
- ip : n'importe quelle adresse IPv4
- cidr : n'importe quelle adresse IPv4 au format CIDR
- local_ip : adresse IPv4 sur un réseau local, si l'adresse IPv4 n'est pas local, un warning sera afficher mais la valeur sera accepté tout de même
- netmask : masque d'une adresse IPv4
- network : adresse réseau
- network_cidr : adresse réseau au format CIDR
- broadcast : adresse de diffusion
- netbios : nom netbios
- domain : nom de domaine
- hostname : nom d'hôte
- web_address : adresse web (http://www.cadoles.com/)
- port : port
- mac : adresse MAC
- schedule : périodicité du schedule, les valeurs possibles sont "none", "daily", "weekly" ou "monthly"
- schedulemod : type de schedule, les valeurs possibles sont "pre" ou "post"
Pour définir le type d'une variable :
```
<variable name="my_variable" type="number"/>
```
## Variable à valeur multiple
Par défaut une variable ne peut acceuillir qu'une seule valeur. Il peut être utile de pouvoir spécifier plusieurs valeurs à une même variable.
Pour définir une variable à valeur multiple :
```
<variable name="my_variable" multi="True"/>
```
## Variable invisible
Il est possible de cacher une variable.
Cacher une variable signifie qu'elle ne sera pas visible lorsqu'on modifie la configuration du service.
Par contre cette variable sera accessibles lorsqu'on va l'utiliser.
Pour cacher une variable :
```
<variable name="my_variable" hidden="True"/>
```
## Variable désactive
Il est possible de désactiver une variable.
Désactiver une variable signifie qu'elle ne sera pas visible lorsqu'on modifie la configuration du service mais également lorsqu'on va l'utiliser.
Pour désactiver une variable :
```
<variable name="my_variable" disabled="True"/>
```
## Variable obligatoire
Variable dont une valeur est requise :
```
<variable name="my_variable" mandatory="True"/>
```
Les variables booléans sont par défaut obligatoire. Pour qu'une variable booléan ne soit pas obligatoire il faut le préciser explicitement :
```
<variable name="my_variable" type="boolean" mandatory="False"/>
```
Les variables avec une valeur par défaut (non calculée) sont également automatiquement obligatoire.
[Les variables à choix](../check/valid_enum.md) sans choix "None" sont également automatiquement obligatoire.
## Valeur par défaut d'une variable
Il est possible de fixer les valeurs par défaut d'une variable :
```
<variable name="my_variable">
<value>value</value>
</variable>
```
Pour une variable multiple, il est possible de préciser plusieurs valeurs :
```
<variable name="my_variable" multi="True">
<value>value 1</value>
<value>value 2</value>
</variable>
```
Si la variable n'est pas pas une [variable meneuse](leadership.md), la première valeur défini dans cette liste sera également la valeur par défaut proposé si on ajoute une nouvelle valeur à cette variable.
Une valeur par défaut peut également être [une valeur calculer](../fill/README.md).
## Redéfinir une variable
Il est possible de définir une variable dans un dictionnaire et de changer son comportement dans une second dictionnaire.
Attention trois attributs ne sont redéfinisable :
- name
- type
- multi
Créons notre variable :
<variable name="my_variable"/>
Et redéfinisons là :
```
<variable name="my_variable" redefine="True" description="New description"/>
```
## Créer une variable inexistante
Il est parfois utile de créer une variable si elle n'existe pas dans un autre dictionnaire :
```
<variable name="my_variable" exists="False"/>
```
Si cette variable existe dans un autre dictionnaire, elle ne sera pas modifié ni recréé
## Redéfinir une variable si elle existe
Parfois on veut pouvoir redéfinir une variable mais seulement dans le cas où elle existe déjà :
```
<variable name="my_variable" redefine="True" exists="True" hidden="True"/>
```
## Variable à valeur automatiquement modifiée
Une variable avec valeur automatiquement modifiée est une variable dont la valeur sera considéré comme modifié quand la propriété global "force_store_value" de Tiramisu est mise.
Voici une variable a valeur automatiquement modifiée :
```
<variable name="my_variable" auto_save="True">
<value>my_value</value>
</variable>
```
Dans ce cas la valeur est fixée à la valeur actuelle.
Par exemple, si la valeur de cette variable est issue d'un calcul, la valeur ne sera plus recalculée.
Ces variables sont généralement des variables obligatoires. En effet ces variable ne sont automatiquement modifiées que si elles ont une valeurs.
Une [variable meneuse ou suiveuse](leadership.md) ne peut pas avoir la propriété auto_save.
## Variable à valeur en lecture seule automatique
Une variable avec valeur en lecture seule automatique est une variable dont la valeur ne sera plus modifiable par l'utilisateur quand la [variable "server_deployed" passe à "True"](../dev/config.md).
Voici un variable à valeur en lecture seule automatique :
```
<variable name="server_deployed" type="boolean">
<value>False</value>
</variable>
<variable name="my_variable" auto_freeze="True"/>
```
Dans ce cas la valeur est fixée à la valeur actuelle et elle ne sera plus modifiable par l'utilisateur.
Par exemple, si la valeur de cette variable est issue d'un calcul, la valeur ne sera plus recalculée.
Ces variables sont généralement des variables obligatoires. En effet ces variable ne sont en lecteur seul que si elles ont une valeurs.
Une [variable meneuse ou suiveuse](leadership.md) ne peut pas avoir la propriété auto_freeze.
## Information "test"
L'attribut "test" est un attribut spécial qui permet aux concepteurs d'un dictionnaire d'influancer le robot de test en précisant de valeurs utile à tester.
Concrêtement, le contenu de cet attribut est enregister dans une "information" de l'option Tiramisu correspondante.
Exemple :
```
<variable name="my_variable" test="yes"/>
```
Il est possible de préciser plusieurs valeurs avec le séparateur "|" :
```
<variable name="my_variable" test="yes|no"/>
```
## Mode de la variable
Le [mode](../mode.md) par défaut d'une variable correspond au [mode](../mode.md) de la [famille](../family/README.md).
Cas particuliers :
- une variable à valeur automatiquement modifiée ou une variable en lecture seule automatique est par défaut en mode "basic".
- si la variable n'est pas dans une famille, la variable aura le mode "normal" par défaut.
- une variable obligatoire sans valeur par défaut (calculer ou non) aura le mode "basic".
Pour définir le [mode](../mode.md) :
```
<variable name="my_variable" mode="expert"/>
```

View File

@ -24,34 +24,59 @@ You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
"""
from .group import GroupAnnotator
from .service import ServiceAnnotator
from .variable import VariableAnnotator, CONVERT_OPTION
from .check import CheckAnnotator
from .value import ValueAnnotator
from .condition import ConditionAnnotator
from .fill import FillAnnotator
from .family import FamilyAnnotator
from .property import PropertyAnnotator
from .variable import CONVERT_OPTION
import importlib.resources
from os.path import dirname, join
from ..utils import load_modules
ANNOTATORS = None
if not 'files' in dir(importlib.resources):
# old python version
class fake_files:
def __init__(self, package):
self.mod = []
dir_package = dirname(importlib.resources._get_package(package).__file__)
for mod in importlib.resources.contents(package):
self.mod.append(join(dir_package, mod))
def iterdir(self):
return self.mod
importlib.resources.files = fake_files
def get_level(module):
return module.level
def get_annotators(annotators, module_name):
annotators[module_name] = []
for pathobj in importlib.resources.files(module_name).iterdir():
path = str(pathobj)
if not path.endswith('__') and not path.endswith('__.py'):
module = load_modules(path)
if 'Annotator' in dir(module):
annotators[module_name].append(module.Annotator)
class SpaceAnnotator: # pylint: disable=R0903
"""Transformations applied on a object instance
"""
def __init__(self, objectspace, eosfunc_file):
self.objectspace = objectspace
GroupAnnotator(objectspace)
ServiceAnnotator(objectspace)
VariableAnnotator(objectspace)
CheckAnnotator(objectspace,
eosfunc_file,
)
ConditionAnnotator(objectspace)
FillAnnotator(objectspace,
eosfunc_file,
)
ValueAnnotator(objectspace)
FamilyAnnotator(objectspace)
PropertyAnnotator(objectspace)
global ANNOTATORS
if ANNOTATORS is None:
ANNOTATORS = {}
get_annotators(ANNOTATORS, 'rougail.annotator')
for extra_annotator in objectspace.rougailconfig['extra_annotators']:
get_annotators(ANNOTATORS, extra_annotator)
annotators = ANNOTATORS['rougail.annotator'].copy()
for extra_annotator in objectspace.rougailconfig['extra_annotators']:
annotators.extend(ANNOTATORS[extra_annotator])
annotators = sorted(annotators, key=get_level)
for annotator in annotators:
annotator(objectspace, eosfunc_file)
__all__ = ('SpaceAnnotator', 'CONVERT_OPTION')

View File

@ -26,21 +26,23 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
"""
from typing import List, Any
from .target import TargetAnnotator
from .param import ParamAnnotator
from rougail.annotator.target import TargetAnnotator
from rougail.annotator.param import ParamAnnotator
from ..utils import load_modules
from ..i18n import _
from ..error import DictConsistencyError, display_xmlfiles
from rougail.utils import load_modules
from rougail.i18n import _
from rougail.error import DictConsistencyError, display_xmlfiles
INTERNAL_FUNCTIONS = ['valid_enum', 'valid_in_network', 'valid_differ', 'valid_entier']
INTERNAL_FUNCTIONS = ['valid_in_network', 'valid_differ', 'valid_entier']
class CheckAnnotator(TargetAnnotator, ParamAnnotator):
class Annotator(TargetAnnotator, ParamAnnotator):
"""Annotate check
"""
level = 40
def __init__(self,
objectspace,
eosfunc_file,
*args,
):
if not hasattr(objectspace.space, 'constraints') or \
not hasattr(objectspace.space.constraints, 'check'):
@ -52,24 +54,15 @@ class CheckAnnotator(TargetAnnotator, ParamAnnotator):
self.functions.extend(INTERNAL_FUNCTIONS)
self.functions.extend(self.objectspace.rougailconfig['internal_functions'])
self.target_is_uniq = False
self.allow_function = True
self.convert_target(self.objectspace.space.constraints.check)
self.convert_param(self.objectspace.space.constraints.check)
self.check_check()
self.check_valid_enum()
self.check_change_warning()
self.convert_valid_entier()
self.convert_check()
del objectspace.space.constraints.check
def valid_type_validation(self,
obj,
) -> None:
variable_type = None
if obj.name == 'valid_enum':
for target in obj.target:
variable_type = target.name.type
return variable_type
def check_check(self): # pylint: disable=R0912
"""valid and manage <check>
"""
@ -84,105 +77,6 @@ class CheckAnnotator(TargetAnnotator, ParamAnnotator):
for idx in remove_indexes:
del self.objectspace.space.constraints.check[idx]
def check_valid_enum(self):
"""verify valid_enum
"""
remove_indexes = []
for idx, check in enumerate(self.objectspace.space.constraints.check):
if check.name != 'valid_enum':
continue
for target in check.target:
if target.name.path in self.objectspace.valid_enums:
check_xmlfiles = display_xmlfiles(self.objectspace.valid_enums\
[target.name.path]['xmlfiles'])
msg = _(f'valid_enum already set in {check_xmlfiles} '
f'for "{target.name.name}", you may have forget remove_check')
raise DictConsistencyError(msg, 3, check.xmlfiles)
if not hasattr(check, 'param'):
msg = _(f'param is mandatory for a valid_enum of variable "{target.name.name}"')
raise DictConsistencyError(msg, 4, check.xmlfiles)
variable_type = target.name.type
values = self._set_valid_enum(target.name,
check,
)
if values:
if hasattr(target.name, 'value'):
# check value
self.check_valid_enum_value(target.name, values)
else:
# no value, set the first choice as default value
new_value = self.objectspace.value(check.xmlfiles)
new_value.name = values[0]
new_value.type = variable_type
target.name.value = [new_value]
remove_indexes.append(idx)
remove_indexes.sort(reverse=True)
for idx in remove_indexes:
del self.objectspace.space.constraints.check[idx]
def _set_valid_enum(self,
variable,
check,
) -> List[Any]:
# build choice
variable.values = []
variable.ori_type = variable.type
variable.type = 'choice'
has_variable = False
values = []
has_nil = False
for param in check.param:
if has_variable:
msg = _(f'only one "variable" parameter is allowed for valid_enum '
f'of variable "{variable.name}"')
raise DictConsistencyError(msg, 5, param.xmlfiles)
param_type = variable.ori_type
if param.type == 'variable':
has_variable = True
if param.optional is True:
msg = _(f'optional parameter in valid_enum for variable "{variable.name}" '
f'is not allowed')
raise DictConsistencyError(msg, 14, param.xmlfiles)
if not param.text.multi:
msg = _(f'only multi "variable" parameter is allowed for valid_enum '
f'of variable "{variable.name}"')
raise DictConsistencyError(msg, 6, param.xmlfiles)
param_type = 'calculation'
elif param.type == 'nil':
has_nil = True
values.append(param.text)
choice = self.objectspace.choice(variable.xmlfiles)
choice.name = param.text
choice.type = param_type
variable.values.append(choice)
if 'mandatory' not in vars(variable):
variable.mandatory = not has_nil
elif variable.mandatory is False:
choice = self.objectspace.choice(variable.xmlfiles)
choice.name = None
choice.type = 'nil'
variable.values.append(choice)
if has_variable:
return None
self.objectspace.valid_enums[variable.path] = {'type': variable.ori_type,
'values': values,
'xmlfiles': check.xmlfiles,
}
return values
@staticmethod
def check_valid_enum_value(variable,
values,
) -> None:
"""check that values in valid_enum are valid
"""
for value in variable.value:
if value.name not in values:
msg = _(f'value "{value.name}" of variable "{variable.name}" is not in list '
f'of all expected values ({values})')
raise DictConsistencyError(msg, 15, value.xmlfiles)
def check_change_warning(self):
"""convert level to "warnings_only"
"""

View File

@ -27,19 +27,21 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
from typing import List
from ..i18n import _
from ..error import DictConsistencyError
from rougail.i18n import _
from rougail.error import DictConsistencyError
from .target import TargetAnnotator
from .param import ParamAnnotator
from .variable import Walk
from rougail.annotator.target import TargetAnnotator
from rougail.annotator.param import ParamAnnotator
from rougail.annotator.variable import Walk
class ConditionAnnotator(TargetAnnotator, ParamAnnotator, Walk):
class Annotator(TargetAnnotator, ParamAnnotator, Walk):
"""Annotate condition
"""
level = 50
def __init__(self,
objectspace,
*args,
):
self.objectspace = objectspace
self.force_service_value = {}
@ -50,6 +52,7 @@ class ConditionAnnotator(TargetAnnotator, ParamAnnotator, Walk):
return
self.target_is_uniq = False
self.only_variable = False
self.allow_function = False
self.convert_target(self.objectspace.space.constraints.condition)
self.check_condition_optional()
self.convert_condition_source()
@ -64,7 +67,7 @@ class ConditionAnnotator(TargetAnnotator, ParamAnnotator, Walk):
obj,
) -> None:
if obj.source.type == 'choice':
return obj.source.ori_type
return None
return obj.source.type
def convert_auto_freeze(self):
@ -74,9 +77,9 @@ class ConditionAnnotator(TargetAnnotator, ParamAnnotator, Walk):
for variable in self.get_variables():
if not variable.auto_freeze and not variable.auto_save:
continue
if variable.namespace != self.objectspace.rougailconfig['variable_namespace']:
msg = _(f'auto_freeze is not allowed in extra "{variable.namespace}"')
raise DictConsistencyError(msg, 49, variable.xmlfiles)
#if variable.namespace != self.objectspace.rougailconfig['variable_namespace']:
# msg = _(f'auto_freeze is not allowed in extra "{variable.namespace}"')
# raise DictConsistencyError(msg, 49, variable.xmlfiles)
variable.force_store_value = True
if variable.auto_save:
continue
@ -89,7 +92,7 @@ class ConditionAnnotator(TargetAnnotator, ParamAnnotator, Walk):
new_condition.param = [new_param]
new_target = self.objectspace.target(variable.xmlfiles)
new_target.type = 'variable'
new_target.name = variable.name
new_target.name = variable.path
new_condition.target = [new_target]
if not hasattr(self.objectspace.space, 'constraints'):
self.objectspace.space.constraints = self.objectspace.constraints(variable.xmlfiles)
@ -161,13 +164,12 @@ class ConditionAnnotator(TargetAnnotator, ParamAnnotator, Walk):
return target.name, [target.name]
# it's a leader, so apply property to leadership
family_name = self.objectspace.paths.get_variable_family_path(target.name.path)
family = self.objectspace.paths.get_family(family_name,
target.name.namespace,
)
return family, family.variable
# it's a family
variable = self.objectspace.paths.get_family(target.name.path,
target.namespace,
namespace = target.name.namespace
else:
family_name = target.name.path
namespace = target.namespace
variable = self.objectspace.paths.get_family(family_name,
namespace,
)
if hasattr(variable, 'variable'):
return variable, list(variable.variable.values())

View File

@ -24,10 +24,9 @@ You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
"""
from ..i18n import _
from ..error import DictConsistencyError
from ..utils import normalize_family
from .variable import Walk
from rougail.i18n import _
from rougail.error import DictConsistencyError
from rougail.annotator.variable import Walk
class Mode: # pylint: disable=R0903
@ -44,11 +43,13 @@ class Mode: # pylint: disable=R0903
return other.level < self.level
class FamilyAnnotator(Walk):
class Annotator(Walk):
"""Annotate family
"""
level = 80
def __init__(self,
objectspace,
*args,
):
self.objectspace = objectspace
if not hasattr(self.objectspace.space, 'variables'):
@ -75,6 +76,7 @@ class FamilyAnnotator(Walk):
def remove_empty_families(self) -> None:
"""Remove all families without any variable
"""
#FIXME pas sous family
for families in self.objectspace.space.variables.values():
removed_families = []
for family_name, family in families.variable.items():
@ -91,7 +93,6 @@ class FamilyAnnotator(Walk):
family.description = family.name
family.doc = family.description
del family.description
family.name = normalize_family(family.name)
def change_modes(self):
"""change the mode of variables
@ -119,7 +120,7 @@ class FamilyAnnotator(Walk):
obj,
) -> None:
modes_level = self.objectspace.rougailconfig['modes_level']
if hasattr(obj, 'mode') and obj.mode not in modes_level:
if self._has_mode(obj) and obj.mode not in modes_level:
msg = _(f'mode "{obj.mode}" for "{obj.name}" is not a valid mode, '
f'valid modes are {modes_level}')
raise DictConsistencyError(msg, 71, obj.xmlfiles)
@ -127,23 +128,29 @@ class FamilyAnnotator(Walk):
def _set_default_mode(self,
family: 'self.objectspace.family',
) -> None:
if hasattr(family, 'mode') and 'mode' in vars(family):
if not hasattr(family, 'variable'):
return
if self._has_mode(family):
family_mode = family.mode
else:
family_mode = None
if not hasattr(family, 'variable'):
return
leader = None
for variable in family.variable.values():
self.valid_mode(variable)
if leader is None and hasattr(family, 'leadership') and family.leadership:
leader = variable
if isinstance(variable, self.objectspace.family):
# set default mode a subfamily
if family_mode and not self._has_mode(variable):
self._set_auto_mode(variable, family_mode)
continue
if isinstance(variable, self.objectspace.leadership):
func = self._set_default_mode_leader
else:
func = self._set_default_mode_variable
func(variable, family_mode)
# set default mode to a variable
self.valid_mode(variable)
if leader:
self._set_default_mode_leader(leader, variable)
self._set_default_mode_variable(variable, family_mode)
if leader:
# here because follower can change leader mode
self._set_auto_mode(family, leader.mode)
@staticmethod
def _has_mode(obj) -> bool:
@ -173,45 +180,35 @@ class FamilyAnnotator(Walk):
obj.mode_auto = True
def _set_default_mode_leader(self,
leadership: 'self.objectspace.leadership',
family_mode: str,
leader: 'self.objectspace.variable',
follower: 'self.objectspace.variable',
) -> None:
leader_mode = None
for follower in leadership.variable:
self.valid_mode(follower)
if follower.auto_save is True:
msg = _(f'leader/followers "{follower.name}" could not be auto_save')
raise DictConsistencyError(msg, 29, leadership.xmlfiles)
raise DictConsistencyError(msg, 29, follower.xmlfiles)
if follower.auto_freeze is True:
msg = f'leader/followers "{follower.name}" could not be auto_freeze'
raise DictConsistencyError(_(msg), 30, leadership.xmlfiles)
if leader_mode is not None:
if hasattr(follower, 'mode'):
raise DictConsistencyError(_(msg), 30, follower.xmlfiles)
if leader == follower:
# it's a leader
if not hasattr(leader, 'mode'):
self._set_auto_mode(leader, self.objectspace.rougailconfig['default_variable_mode'])
return
if self._has_mode(follower):
follower_mode = follower.mode
else:
follower_mode = self.objectspace.rougailconfig['default_variable_mode']
if self.modes[leader_mode] > self.modes[follower_mode]:
if self._has_mode(follower) and not self._has_mode(leadership.variable[0]):
if self.modes[leader.mode] > self.modes[follower_mode]:
if self._has_mode(follower) and not self._has_mode(leader):
# if follower has mode but not the leader
self._set_auto_mode(leadership.variable[0], follower_mode)
self._set_auto_mode(leader, follower_mode)
else:
# leader's mode is minimum level
if self._has_mode(follower):
msg = _(f'the follower "{follower.name}" is in "{follower_mode}" mode '
f'but leader have the higher mode "{leader_mode}"')
f'but leader have the higher mode "{leader.mode}"')
raise DictConsistencyError(msg, 63, follower.xmlfiles)
self._set_auto_mode(follower, leader_mode)
self._set_default_mode_variable(follower,
family_mode,
)
if leader_mode is None:
if hasattr(leadership.variable[0], 'mode'):
leader_mode = leadership.variable[0].mode
else:
leader_mode = self.objectspace.rougailconfig['default_variable_mode']
if hasattr(leadership.variable[0], 'mode'):
leader_mode = leadership.variable[0].mode
self._set_auto_mode(leadership, leader_mode)
self._set_auto_mode(follower, leader.mode)
def _change_family_mode(self,
family: 'self.objectspace.family',
@ -222,39 +219,41 @@ class FamilyAnnotator(Walk):
family_mode = self.objectspace.rougailconfig['default_family_mode']
min_variable_mode = self.objectspace.rougailconfig['modes_level'][-1]
# change variable mode, but not if variables are not in a family
is_leadership = hasattr(family, 'leadership') and family.leadership
if hasattr(family, 'variable'):
for variable in family.variable.values():
if not isinstance(variable, self.objectspace.family):
if isinstance(variable, self.objectspace.leadership):
func = self._change_variable_mode_leader
else:
func = self._change_variable_mode
func(variable,
family_mode,
)
elif not hasattr(variable, 'mode'):
for idx, variable in enumerate(family.variable.values()):
if isinstance(variable, self.objectspace.family):
if not hasattr(variable, 'mode'):
variable.mode = self.objectspace.rougailconfig['default_family_mode']
elif idx == 0 and is_leadership:
variable.mode = None
continue
else:
self._change_variable_mode(variable, family_mode, is_leadership)
if self.modes[min_variable_mode] > self.modes[variable.mode]:
min_variable_mode = variable.mode
if isinstance(family, self.objectspace.family) and \
(not hasattr(family, 'mode') or family.mode != min_variable_mode):
if not isinstance(family, self.objectspace.family) or is_leadership:
# it's Variable, Service, ... and leadership
return
if not hasattr(family, 'mode'):
# set the lower variable mode to family
if self._has_mode(family):
self._set_auto_mode(family, min_variable_mode)
if family.mode != min_variable_mode:
msg = _(f'the family "{family.name}" is in "{family.mode}" mode but variables and '
f'families inside have the higher modes "{min_variable_mode}"')
raise DictConsistencyError(msg, 62, family.xmlfiles)
self._set_auto_mode(family, min_variable_mode)
def _change_variable_mode(self,
variable,
family_mode: str,
is_follower: bool,
) -> None:
if hasattr(variable, 'mode'):
variable_mode = variable.mode
else:
variable_mode = self.objectspace.rougailconfig['default_variable_mode']
# none basic variable in high level family has to be in high level
if self.modes[variable_mode] < self.modes[family_mode]:
if not is_follower and self.modes[variable_mode] < self.modes[family_mode]:
if self._has_mode(variable):
msg = _(f'the variable "{variable.name}" is in "{variable_mode}" mode '
f'but family has the higher family mode "{family_mode}"')
@ -263,16 +262,6 @@ class FamilyAnnotator(Walk):
if not hasattr(variable, 'mode'):
variable.mode = variable_mode
def _change_variable_mode_leader(self,
leadership,
family_mode: str,
) -> None:
for follower in leadership.variable:
self._change_variable_mode(follower,
family_mode,
)
leadership.variable[0].mode = None
def dynamic_families(self):
"""link dynamic families to object
"""
@ -286,7 +275,7 @@ class FamilyAnnotator(Walk):
f'to multi variable')
raise DictConsistencyError(msg, 16, family.xmlfiles)
for variable in family.variable.values():
if isinstance(variable, self.objectspace.family):
if isinstance(variable, self.objectspace.family) and not variable.leadership:
msg = _(f'dynamic family "{family.name}" cannot contains another family')
raise DictConsistencyError(msg, 22, family.xmlfiles)

View File

@ -24,52 +24,70 @@ You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
"""
from ..utils import load_modules
from ..i18n import _
from ..error import DictConsistencyError
from rougail.utils import load_modules
from rougail.i18n import _
from rougail.error import DictConsistencyError
from .target import TargetAnnotator
from .param import ParamAnnotator
from rougail.annotator.target import TargetAnnotator
from rougail.annotator.param import ParamAnnotator
class FillAnnotator(TargetAnnotator, ParamAnnotator):
CALC_MULTI = ('calc_value', 'calc_list', 'get_range', 'calc_val_first_value', 'unbound_filename', 'zone_information')
class Annotator(TargetAnnotator, ParamAnnotator):
"""Fill annotator
"""
level = 60
def __init__(self,
objectspace,
eosfunc_file,
*args,
):
self.objectspace = objectspace
if not hasattr(objectspace.space, 'constraints') or \
not hasattr(self.objectspace.space.constraints, 'fill'):
not hasattr(objectspace.space.constraints, 'fill'):
return
self.objectspace = objectspace
self.functions = dir(load_modules(eosfunc_file))
self.functions.extend(self.objectspace.rougailconfig['internal_functions'])
self.target_is_uniq = True
self.only_variable = True
self.allow_function = False
self.convert_target(self.objectspace.space.constraints.fill)
self.convert_param(self.objectspace.space.constraints.fill)
self.fill_to_value()
del self.objectspace.space.constraints.fill
def calc_is_multi(self, variable: 'self.objectspace.variable') -> bool:
multi = variable.multi
if multi is False:
return multi
if multi == 'submulti':
return True
return not self.objectspace.paths.is_follower(variable.path)
def fill_to_value(self) -> None:
"""valid and manage <fill>
"""
for fill in self.objectspace.space.constraints.fill:
for target in fill.target:
# test if the function exists
if fill.name not in self.functions:
msg = _(f'cannot find fill function "{fill.name}"')
raise DictConsistencyError(msg, 25, fill.xmlfiles)
for target in fill.target:
# create an object value
value = self.objectspace.value(fill.xmlfiles)
value.type = 'calculation'
value.name = fill.name
if fill.name not in CALC_MULTI:
is_calc_multi = self.calc_is_multi(target.name)
else:
is_calc_multi = False
value.calc_multi = is_calc_multi
if target.name.namespace == 'services':
target.name.default = value
else:
target.name.value = [value]
# manage params
if hasattr(fill, 'param') and fill.param:
value.param = fill.param

View File

@ -24,137 +24,54 @@ You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
"""
from ..i18n import _
from ..error import DictConsistencyError
from ..utils import normalize_family
from rougail.i18n import _
from rougail.error import DictConsistencyError
from rougail.utils import normalize_family
from rougail.annotator.variable import Walk
class GroupAnnotator:
class Annotator(Walk):
"""Annotate group
"""
level = 10
def __init__(self,
objectspace,
*args,
):
self.objectspace = objectspace
if not hasattr(self.objectspace.space, 'constraints') or \
not hasattr(self.objectspace.space.constraints, 'group'):
if not hasattr(objectspace.space, 'variables'):
return
self.objectspace = objectspace
self.convert_groups()
def convert_groups(self): # pylint: disable=C0111
"""convert groups
"""
# store old leaders family name
cache_paths = {}
for group in self.objectspace.space.constraints.group:
if group.leader in cache_paths:
leader_fam_path = cache_paths[group.leader]
else:
leader_fam_path = self.objectspace.paths.get_variable_family_path(group.leader, group.xmlfiles)
cache_paths[group.leader] = leader_fam_path
follower_names = list(group.follower.keys())
leader = self.objectspace.paths.get_variable(group.leader)
if '.' not in leader_fam_path:
# it's a namespace
ori_leader_family = self.objectspace.space.variables[leader_fam_path]
else:
# it's a sub family
ori_leader_family = self.objectspace.paths.get_family(leader_fam_path,
leader.namespace,
)
has_a_leader = False
for variable in list(ori_leader_family.variable.values()):
if isinstance(variable, self.objectspace.leadership) and \
variable.variable[0].name == leader.name:
# append follower to an existed leadership
leader_space = variable
has_a_leader = True
elif variable.name == leader.name:
for family in self.get_families():
if not isinstance(family, self.objectspace.family):
continue
if not family.leadership:
continue
if hasattr(family, 'dynamic'):
msg = _(f'the family "{family.name}" cannot be leadership and dynamic together')
raise DictConsistencyError(msg, 31, family.xmlfiles)
for idx, variable in enumerate(family.variable.values()):
if idx == 0:
# it's a leader
leader_space = self.manage_leader(variable,
group,
ori_leader_family,
)
has_a_leader = True
elif has_a_leader:
# it's should be a follower
self.manage_follower(follower_names.pop(0),
leader_fam_path,
variable,
leader_space,
)
# this variable is not more in ori_leader_family
ori_leader_family.variable.pop(normalize_family(variable.name))
if follower_names == []:
# no more follower
break
else:
joined = '", "'.join(follower_names)
msg = _(f'when parsing leadership, we espect to find those followers "{joined}"')
raise DictConsistencyError(msg, 31, variable.xmlfiles)
del self.objectspace.space.constraints.group
def manage_leader(self,
variable: 'Variable',
group: 'Group',
ori_leader_family,
) -> 'Leadership':
"""manage leader's variable
"""
if variable.multi is not True:
msg = _(f'the variable "{variable.name}" in a group must be multi')
msg = _(f'the variable "{variable.name}" in a leadership must be multi')
raise DictConsistencyError(msg, 32, variable.xmlfiles)
if hasattr(group, 'name'):
ori_leadership_name = group.name
else:
ori_leadership_name = variable.name
leadership_name = normalize_family(ori_leadership_name)
leader_space = self.objectspace.leadership(variable.xmlfiles)
leader_space.variable = []
leader_space.name = leadership_name
leader_space.hidden = variable.hidden
family.hidden = variable.hidden
if variable.hidden:
variable.frozen = True
variable.force_default_on_freeze = True
variable.hidden = None
if hasattr(group, 'description'):
leader_space.doc = group.description
elif variable.name == leadership_name and hasattr(variable, 'description'):
leader_space.doc = variable.description
else:
leader_space.doc = ori_leadership_name
leadership_path = ori_leader_family.path + '.' + leadership_name
self.objectspace.paths.add_leadership(variable.namespace,
leadership_path,
leader_space,
)
ori_leader_family.variable[normalize_family(variable.name)] = leader_space
leader_space.variable.append(variable)
self.objectspace.paths.set_leader(variable.namespace,
ori_leader_family.path,
leadership_name,
normalize_family(variable.name),
)
return leader_space
def manage_follower(self,
follower_name: str,
leader_family_name: str,
variable: 'Variable',
leader_space: 'Leadership',
) -> None:
"""manage follower
"""
if variable.name != follower_name:
msg = _('when parsing leadership, we expect to find the follower '
f'"{follower_name}" but we found "{variable.name}"')
raise DictConsistencyError(msg, 33, variable.xmlfiles)
self.objectspace.paths.set_leader(variable.namespace,
leader_family_name,
leader_space.name,
normalize_family(variable.name),
)
if leader_space.hidden:
# it's a follower
if family.hidden:
variable.frozen = True
variable.force_default_on_freeze = True
leader_space.variable.append(variable)
if variable.multi is True:
variable.multi = 'submulti'
else:
variable.multi = True

View File

@ -24,12 +24,15 @@ You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
"""
try:
import tiramisu3 as tiramisu
except ModuleNotFoundError:
import tiramisu
from .variable import CONVERT_OPTION
from rougail.annotator.variable import CONVERT_OPTION
from ..i18n import _
from ..error import DictConsistencyError
from rougail.i18n import _
from rougail.error import DictConsistencyError
class ParamAnnotator:
@ -82,6 +85,16 @@ class ParamAnnotator:
if err.errno != 42 or not param.optional:
raise err
param_to_delete.append(param_idx)
elif param.type == 'function':
if not self.allow_function:
msg = _(f'cannot use "function" type')
raise DictConsistencyError(msg, 74, param.xmlfiles)
if not param.text in self.functions:
msg = _(f'cannot find function "{param.text}"')
raise DictConsistencyError(msg, 67, param.xmlfiles)
if param_idx != 0:
msg = _(f'function "{param.text}" must only set has first parameter')
raise DictConsistencyError(msg, 75, param.xmlfiles)
elif variable_type:
self._convert_with_variable_type(variable_type, param)
continue
@ -119,6 +132,7 @@ class ParamAnnotator:
msg = _(f'parameter has incompatible type "{param.type}" '
f'with type "{variable_type}"')
raise DictConsistencyError(msg, 7, param.xmlfiles)
if variable_type != 'choice':
try:
option = CONVERT_OPTION[variable_type]
param.text = option.get('func', str)(param.text)

View File

@ -24,19 +24,23 @@ You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
"""
from ..i18n import _
from ..error import DictConsistencyError
from .variable import Walk
from rougail.i18n import _
from rougail.error import DictConsistencyError
from rougail.annotator.variable import Walk
PROPERTIES = ('hidden', 'frozen', 'force_default_on_freeze',
'force_store_value', 'disabled', 'mandatory')
class PropertyAnnotator(Walk):
class Annotator(Walk):
"""Annotate properties
"""
def __init__(self, objectspace):
level = 90
def __init__(self,
objectspace,
*args
) -> None:
self.objectspace = objectspace
if hasattr(self.objectspace.space, 'services'):
self.convert_services()
@ -50,7 +54,8 @@ class PropertyAnnotator(Walk):
"""convert properties
"""
# hidden variable is also frozen
if isinstance(variable, self.objectspace.variable) and variable.hidden is True:
if isinstance(variable, self.objectspace.variable) and variable.hidden is True and \
variable.name != self.objectspace.rougailconfig['auto_freeze_variable']:
if not variable.auto_freeze:
variable.frozen = True
if not variable.auto_save and \
@ -101,8 +106,5 @@ class PropertyAnnotator(Walk):
def convert_variable(self) -> None:
"""convert variables
"""
for variable in self.get_variables(with_leadership=True):
if isinstance(variable, self.objectspace.leadership):
for follower in variable.variable:
self.convert_property(follower)
for variable in self.get_variables():
self.convert_property(variable)

View File

@ -27,20 +27,17 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
from os.path import basename
from typing import Tuple
from ..i18n import _
from ..utils import normalize_family
from ..error import DictConsistencyError
from ..config import RougailConfig
from rougail.i18n import _
from rougail.utils import normalize_family
from rougail.error import DictConsistencyError
# a object's attribute has some annotations
# that shall not be present in the exported (flatened) XML
ERASED_ATTRIBUTES = ('redefine', 'exists', 'optional', 'remove_check', 'namespace',
'remove_condition', 'path', 'instance_mode', 'index',
'level', 'remove_fill', 'xmlfiles', 'type', 'reflector_name',
'reflector_object',)
ALLOW_ATTRIBUT_NOT_MANAGE = ['file']
ERASED_ATTRIBUTES = ('redefine', 'namespace', 'xmlfiles', 'disabled', 'name', 'manage')
ERASED_ATTRIBUTES2 = ('redefine', 'namespace', 'xmlfiles')
ALLOW_ATTRIBUT_NOT_MANAGE = ['file', 'engine', 'target']
class ServiceAnnotator:
class Annotator:
"""Manage service's object
for example::
<services>
@ -50,7 +47,11 @@ class ServiceAnnotator:
</service>
</services>
"""
def __init__(self, objectspace):
level = 20
def __init__(self,
objectspace,
*args,
) -> None:
self.objectspace = objectspace
self.uniq_overrides = []
if 'network_type' not in self.objectspace.types:
@ -69,14 +70,16 @@ class ServiceAnnotator:
self.objectspace.space.services.doc = 'services'
self.objectspace.space.services.path = 'services'
for service_name, service in self.objectspace.space.services.service.items():
service.name = normalize_family(service_name)
activate_obj = self._generate_element('boolean',
None,
None,
'activate',
True,
not service.disabled,
service,
'.'.join(['services', normalize_family(service_name), 'activate']),
'.'.join(['services', service.name, 'activate']),
)
service.disabled = None
for elttype, values in dict(vars(service)).items():
if elttype == 'servicelist':
self.objectspace.list_conditions.setdefault('servicelist',
@ -84,19 +87,21 @@ class ServiceAnnotator:
values,
[]).append(activate_obj)
continue
if not isinstance(values, (dict, list)) or elttype in ERASED_ATTRIBUTES:
if elttype in ERASED_ATTRIBUTES:
continue
if not service.manage and elttype not in ALLOW_ATTRIBUT_NOT_MANAGE:
msg = _(f'unmanage service cannot have "{elttype}"')
raise DictConsistencyError(msg, 66, service.xmlfiles)
if isinstance(values, (dict, list)):
if elttype != 'ip':
eltname = elttype + 's'
else:
eltname = elttype
path = '.'.join(['services', normalize_family(service_name), eltname])
path = '.'.join(['services', service.name, eltname])
family = self._gen_family(eltname,
path,
service.xmlfiles,
with_informations=False,
)
if isinstance(values, dict):
values = list(values.values())
@ -106,16 +111,20 @@ class ServiceAnnotator:
path,
)
setattr(service, elttype, family)
else:
if not hasattr(service, 'information'):
service.information = self.objectspace.information(service.xmlfiles)
setattr(service.information, elttype, values)
manage = self._generate_element('boolean',
None,
None,
'manage',
service.manage,
service,
'.'.join(['services', normalize_family(service_name), 'manage']),
'.'.join(['services', service.name, 'manage']),
)
service.variable = [activate_obj, manage]
service.doc = service.name
service.doc = service_name
def make_group_from_elts(self,
service_name,
@ -152,7 +161,7 @@ class ServiceAnnotator:
'.'.join([subpath, 'activate']),
)
for key in dir(elt):
if key.startswith('_') or key.endswith('_type') or key in ERASED_ATTRIBUTES:
if key.startswith('_') or key.endswith('_type') or key in ERASED_ATTRIBUTES2:
continue
value = getattr(elt, key)
if key == listname:
@ -165,7 +174,8 @@ class ServiceAnnotator:
dtd_key_type = elttype + '_type'
else:
dtd_key_type = key + '_type'
elt_type = getattr(elt, dtd_key_type, 'string')
elt_type = getattr(elt, dtd_key_type, None)
if elt_type:
if elt_type == 'variable':
elt_type = 'symlink'
family.variable.append(self._generate_element(elt_type,
@ -176,6 +186,9 @@ class ServiceAnnotator:
elt,
f'{subpath}.{key}'
))
else:
setattr(family.information, key, value)
family.variable.append(activate_obj)
families.append(family)
return families
@ -205,7 +218,8 @@ class ServiceAnnotator:
def _gen_family(self,
name,
path,
xmlfiles
xmlfiles,
with_informations=True,
):
family = self.objectspace.family(xmlfiles)
family.name = normalize_family(name)
@ -216,6 +230,8 @@ class ServiceAnnotator:
family,
None,
)
if with_informations:
family.information = self.objectspace.information(xmlfiles)
return family
def _generate_element(self,
@ -263,8 +279,6 @@ class ServiceAnnotator:
raise DictConsistencyError(msg, 69, override.xmlfiles)
self.uniq_overrides.append(service_name)
override.name = service_name
if not hasattr(override, 'engine'):
override.engine = RougailConfig['default_engine']
if not hasattr(override, 'source'):
override.source = f'{service_name}.service'
@ -279,8 +293,6 @@ class ServiceAnnotator:
msg = _(f'attribute "source" is mandatory for the file "{file_.name}" '
f'"({service_name})"')
raise DictConsistencyError(msg, 34, file_.xmlfiles)
if not hasattr(file_, 'engine'):
file_.engine = RougailConfig['default_engine']
def _update_ip(self,
ip,

View File

@ -24,8 +24,8 @@ You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
"""
from ..i18n import _
from ..error import DictConsistencyError
from rougail.i18n import _
from rougail.error import DictConsistencyError
class TargetAnnotator:

View File

@ -24,39 +24,33 @@ You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
"""
from .variable import Walk
from rougail.annotator.variable import Walk
from ..i18n import _
from ..error import DictConsistencyError
from rougail.i18n import _
from rougail.error import DictConsistencyError
class ValueAnnotator(Walk): # pylint: disable=R0903
class Annotator(Walk): # pylint: disable=R0903
"""Annotate value
"""
level = 70
def __init__(self,
objectspace,
*args,
) -> None:
if not hasattr(objectspace.space, 'variables'):
return
self.objectspace = objectspace
self.convert_value()
self.add_choice_nil()
def convert_value(self) -> None:
"""convert value
"""
for variable in self.get_variables(with_leadership=True):
if isinstance(variable, self.objectspace.leadership):
variable_type = 'leader'
for follower in variable.variable:
self._convert_value(follower,
variable_type,
)
variable_type = 'follower'
else:
for variable in self.get_variables():
self._convert_value(variable)
def _convert_value(self,
variable,
variable_type: str=None,
) -> None:
# a boolean must have value, the default value is "True"
if not hasattr(variable, 'value') and variable.type == 'boolean':
@ -80,19 +74,32 @@ class ValueAnnotator(Walk): # pylint: disable=R0903
return
if variable.value[0].type == 'calculation':
variable.default = variable.value[0]
else:
if variable.multi:
if variable_type != 'follower':
elif variable.multi:
if not self.objectspace.paths.is_follower(variable.path):
variable.default = [value.name for value in variable.value]
if variable_type != 'leader':
if not self.objectspace.paths.is_leader(variable.path):
if variable.multi == 'submulti':
variable.default_multi = [value.name for value in variable.value]
else:
variable.default_multi = variable.value[0].name
else:
if len(variable.value) > 1:
msg = _(f'the non multi variable "{variable.name}" cannot have '
msg = _(f'the none multi variable "{variable.name}" cannot have '
'more than one value')
raise DictConsistencyError(msg, 68, variable.xmlfiles)
variable.default = variable.value[0].name
del variable.value
def add_choice_nil(self) -> None:
for variable in self.get_variables():
if variable.type != 'choice':
continue
is_none = False
for choice in variable.choice:
if choice.type == 'nil':
is_none = True
if not variable.mandatory and not is_none:
choice = self.objectspace.choice(variable.xmlfiles)
choice.name = None
choice.type = 'nil'
variable.choice.append(choice)

View File

@ -25,10 +25,9 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
"""
from ..i18n import _
from ..error import DictConsistencyError
from ..objspace import convert_boolean
from ..utils import normalize_family
from rougail.i18n import _
from rougail.error import DictConsistencyError
from rougail.objspace import convert_boolean
CONVERT_OPTION = {'number': dict(opttype="IntOption", func=int),
@ -50,7 +49,7 @@ CONVERT_OPTION = {'number': dict(opttype="IntOption", func=int),
'broadcast': dict(opttype="BroadcastOption"),
'netbios': dict(opttype="DomainnameOption", initkwargs={'type': 'netbios',
'warnings_only': True}),
'domain': dict(opttype="DomainnameOption", initkwargs={'type': 'domainname',
'domainname': dict(opttype="DomainnameOption", initkwargs={'type': 'domainname',
'allow_ip': False}),
'hostname': dict(opttype="DomainnameOption", initkwargs={'type': 'hostname',
'allow_ip': False}),
@ -63,37 +62,26 @@ CONVERT_OPTION = {'number': dict(opttype="IntOption", func=int),
}
FORCE_CHOICE = {'schedule': ['none', 'daily', 'weekly', 'monthly'],
'schedulemod': ['pre', 'post'],
}
class Walk:
"""Walk to objectspace to find variable or family
"""
objectspace = None
def get_variables(self,
with_leadership: bool=False,
):
def get_variables(self):
"""Iter all variables from the objectspace
"""
for family in self.objectspace.space.variables.values():
yield from self._get_variables(family, with_leadership)
yield from self._get_variables(family)
def _get_variables(self,
family: 'self.objectspace.family',
with_leadership: bool
):
if hasattr(family, 'variable'):
if not hasattr(family, 'variable'):
return
for variable in family.variable.values():
if isinstance(variable, self.objectspace.family):
yield from self._get_variables(variable, with_leadership)
continue
if not with_leadership and isinstance(variable, self.objectspace.leadership):
for follower in variable.variable:
yield follower
continue
yield from self._get_variables(variable)
else:
yield variable
def get_families(self):
@ -106,17 +94,20 @@ class Walk:
family: 'self.objectspace.family',
):
yield family
if hasattr(family, 'variable'):
if not hasattr(family, 'variable'):
return
for fam in family.variable.values():
if isinstance(fam, self.objectspace.family):
yield from self._get_families(fam)
class VariableAnnotator(Walk): # pylint: disable=R0903
class Annotator(Walk): # pylint: disable=R0903
"""Annotate variable
"""
level = 30
def __init__(self,
objectspace,
*args,
):
if not hasattr(objectspace.space, 'variables'):
return
@ -131,23 +122,11 @@ class VariableAnnotator(Walk): # pylint: disable=R0903
def convert_variable(self):
"""convert variable
"""
for variable in self.get_variables(with_leadership=True):
if isinstance(variable, self.objectspace.leadership):
# first variable is a leader, others are follower
variable_type = 'leader'
for follower in variable.variable:
self._convert_variable(follower,
variable_type,
)
variable_type = 'follower'
else:
self._convert_variable(variable,
'variable',
)
for variable in self.get_variables():
self._convert_variable(variable)
def _convert_variable(self,
variable,
variable_type: str,
) -> None:
if variable.namespace == self.objectspace.rougailconfig['variable_namespace'] and \
variable.name in self.forbidden_name:
@ -170,73 +149,75 @@ class VariableAnnotator(Walk): # pylint: disable=R0903
del variable.value[idx]
if not variable.value:
del variable.value
variable.doc = variable.description
variable.name = normalize_family(variable.name)
del variable.description
if variable_type == 'follower':
if variable.multi is True:
variable.multi = 'submulti'
if hasattr(variable, 'choice'):
if variable.type != 'choice':
msg = _(f'choice for the variable "{variable.name}" not allowed with "{variable.type}" type')
raise DictConsistencyError(msg, 3, variable.xmlfiles)
values = []
choice_type = None
for choice in variable.choice:
if choice_type == 'variable':
msg = _(f'only one "variable" choice is allowed '
f'the variable "{variable.name}"')
raise DictConsistencyError(msg, 5, choice.xmlfiles)
if choice.type == 'nil':
choice.name = None
elif choice.type == 'variable':
choice.name = self.objectspace.paths.get_variable(choice.name)
if not choice.name.multi:
msg = _(f'only multi "variable" is allowed for a choice '
f'of variable "{variable.name}"')
raise DictConsistencyError(msg, 6, choice.xmlfiles)
else:
variable.multi = True
self._convert_valid_enum(variable)
def _convert_valid_enum(self,
variable,
):
"""some types are, in fact, choices
convert this kind of variables into choice
"""
if variable.type in FORCE_CHOICE:
if not hasattr(self.objectspace.space, 'constraints'):
xmlfiles = variable.xmlfiles
self.objectspace.space.constraints = self.objectspace.constraints(xmlfiles)
self.objectspace.space.constraints.namespace = variable.namespace
if not hasattr(self.objectspace.space.constraints, 'check'):
self.objectspace.space.constraints.check = []
check = self.objectspace.check(variable.xmlfiles)
check.name = 'valid_enum'
target = self.objectspace.target(variable.xmlfiles)
target.name = variable.path
check.target = [target]
check.namespace = variable.namespace
check.param = []
for value in FORCE_CHOICE[variable.type]:
param = self.objectspace.param(variable.xmlfiles)
param.text = value
check.param.append(param)
self.objectspace.space.constraints.check.append(check)
variable.type = 'string'
if not hasattr(choice, 'name'):
msg = _(f'choice for variable "{variable.name}" must have a value')
raise DictConsistencyError(msg, 14, choice.xmlfiles)
choice.name = CONVERT_OPTION.get(choice.type, {}).get('func', str)(choice.name)
if choice_type is None:
choice_type = choice.type
values.append(choice.name)
if choice_type not in ['function', 'variable'] and hasattr(variable, 'value'):
for value in variable.value:
if value.name not in values:
msg = _(f'value "{value.name}" of variable "{variable.name}" is not in list '
f'of all expected values ({values})')
raise DictConsistencyError(msg, 15, value.xmlfiles)
ref_choice = variable.choice[0]
self.objectspace.valid_enums[variable.path] = {'type': ref_choice.type,
'values': values,
'xmlfiles': ref_choice.xmlfiles,
}
elif variable.type == 'choice':
msg = _(f'choice is mandatory for the variable "{variable.name}" with choice type')
raise DictConsistencyError(msg, 4, variable.xmlfiles)
variable.doc = variable.description
del variable.description
def convert_test(self):
"""Convert variable tests value
"""
for variable in self.get_variables():
if not hasattr(variable, 'test'):
if not hasattr(variable, 'test') or not variable.test:
# with we want remove test, we set "" has test value
continue
if variable.test:
if not hasattr(variable, 'information'):
variable.information = self.objectspace.information(variable.xmlfiles)
values = variable.test.split('|')
new_values = []
for value in values:
for value in variable.test.split('|'):
if value == '':
value = None
else:
value = CONVERT_OPTION.get(variable.type, {}).get('func', str)(value)
new_values.append(value)
if not hasattr(variable, 'information'):
variable.information = self.objectspace.information(variable.xmlfiles)
variable.information.test = tuple(new_values)
del variable.test
def convert_help(self):
"""Convert variable help
"""
for variable in self.get_variables():
if not hasattr(variable, 'help'):
continue
if not hasattr(variable, 'information'):
variable.information = self.objectspace.information(variable.xmlfiles)
self._convert_help(variable)
@staticmethod
def _convert_help(variable) -> None:
if hasattr(variable, 'help'):
variable.information.help = variable.help
del variable.help

View File

@ -42,9 +42,15 @@ RougailConfig = {'dictionaries_dir': [join(ROUGAILROOT, 'dictionaries')],
'functions_file': join(ROUGAILROOT, 'functions.py'),
'variable_namespace': 'rougail',
'auto_freeze_variable': 'server_deployed',
'default_engine': 'creole',
'internal_functions': [],
'extra_annotators': [],
'modes_level': ['basic', 'normal', 'expert'],
'default_family_mode': 'basic',
'default_variable_mode': 'normal',
'default_files_engine': 'creole',
'default_files_mode': '0644',
'default_files_owner': 'root',
'default_files_group': 'root',
'default_files_included': 'no',
'default_overrides_engine': 'creole',
}

View File

@ -38,7 +38,7 @@
<!-- =============== -->
<!ELEMENT rougail (services|variables|constraints)*>
<!ATTLIST rougail version (0.9) #REQUIRED>
<!ATTLIST rougail version (0.10) #REQUIRED>
<!-- ============== -->
<!-- files element -->
@ -50,6 +50,10 @@
<!ATTLIST service name CDATA #REQUIRED>
<!ATTLIST service manage (True|False) "True">
<!ATTLIST service servicelist CDATA #IMPLIED>
<!ATTLIST service disabled (True|False) "False">
<!ATTLIST service engine (none|creole|jinja2) #IMPLIED>
<!ATTLIST service target CDATA #IMPLIED>
<!ATTLIST service type (service|mount) "service">
<!ELEMENT ip (#PCDATA)>
<!ATTLIST ip iplist CDATA #IMPLIED>
@ -62,13 +66,13 @@
<!ATTLIST file variable CDATA #IMPLIED>
<!ATTLIST file variable_type (variable) "variable">
<!ATTLIST file source CDATA #IMPLIED>
<!ATTLIST file mode CDATA "0644">
<!ATTLIST file owner CDATA "root">
<!ATTLIST file group CDATA "root">
<!ATTLIST file mode CDATA #IMPLIED>
<!ATTLIST file owner CDATA #IMPLIED>
<!ATTLIST file group CDATA #IMPLIED>
<!ATTLIST file filelist CDATA #IMPLIED>
<!ATTLIST file redefine (True|False) "False">
<!ATTLIST file engine (none|creole|jinja2|creole_legacy) #IMPLIED>
<!ATTLIST file included (no|name|content) "no">
<!ATTLIST file included (no|name|content) #IMPLIED>
<!ELEMENT override EMPTY>
<!ATTLIST override source CDATA #IMPLIED>
@ -83,10 +87,12 @@
<!ATTLIST family mode CDATA #IMPLIED>
<!ATTLIST family hidden (True|False) "False">
<!ATTLIST family dynamic CDATA #IMPLIED>
<!ATTLIST family leadership (True|False) "False">
<!ATTLIST family provider CDATA #IMPLIED>
<!ELEMENT variable (value*)>
<!ELEMENT variable ((choice*|value*)*)>
<!ATTLIST variable name CDATA #REQUIRED>
<!ATTLIST variable type (number|float|string|password|mail|boolean|filename|date|unix_user|ip|local_ip|netmask|network|broadcast|netbios|domain|hostname|web_address|port|mac|cidr|network_cidr|schedule|schedulemod) "string">
<!ATTLIST variable type (number|float|string|password|mail|boolean|filename|date|unix_user|ip|local_ip|netmask|network|broadcast|netbios|domainname|hostname|web_address|port|mac|cidr|network_cidr|choice) "string">
<!ATTLIST variable description CDATA #IMPLIED>
<!ATTLIST variable help CDATA #IMPLIED>
<!ATTLIST variable hidden (True|False) "False">
@ -98,14 +104,21 @@
<!ATTLIST variable auto_freeze (True|False) "False">
<!ATTLIST variable auto_save (True|False) "False">
<!ATTLIST variable mode CDATA #IMPLIED>
<!ATTLIST variable remove_choice (True|False) "False">
<!ATTLIST variable remove_check (True|False) "False">
<!ATTLIST variable remove_condition (True|False) "False">
<!ATTLIST variable remove_fill (True|False) "False">
<!ATTLIST variable provider CDATA #IMPLIED>
<!ATTLIST variable test CDATA #IMPLIED>
<!ELEMENT value (#PCDATA)>
<!ATTLIST value type (string|number|nil|boolean) #IMPLIED>
<!ELEMENT constraints ((fill*|check*|condition*|group*)*)>
<!ELEMENT choice (#PCDATA | param)*>
<!ATTLIST choice type (string|number|nil|boolean|function|variable) "string">
<!ATTLIST choice name CDATA #IMPLIED>
<!ELEMENT constraints ((fill*|check*|condition*)*)>
<!ELEMENT fill ((target|param)+)>
<!ATTLIST fill name CDATA #REQUIRED>
@ -121,7 +134,7 @@
<!ATTLIST condition apply_on_fallback (True|False) #IMPLIED>
<!ELEMENT param (#PCDATA)>
<!ATTLIST param type (string|number|nil|boolean|variable|information|suffix|index) "string">
<!ATTLIST param type (string|number|nil|boolean|variable|function|information|target_information|suffix|index) "string">
<!ATTLIST param name CDATA #IMPLIED>
<!ATTLIST param propertyerror (True|False) "True">
<!ATTLIST param optional (True|False) "False">
@ -129,10 +142,3 @@
<!ELEMENT target (#PCDATA)>
<!ATTLIST target type (variable|family|servicelist|filelist|iplist) "variable">
<!ATTLIST target optional (True|False) "False">
<!ELEMENT group (follower+)>
<!ATTLIST group leader CDATA #REQUIRED>
<!ATTLIST group name CDATA #IMPLIED>
<!ATTLIST group description CDATA #IMPLIED>
<!ELEMENT follower (#PCDATA)>

View File

@ -29,7 +29,7 @@ from typing import Optional
from .i18n import _
from .xmlreflector import XMLReflector
from .utils import normalize_family
from .utils import valid_variable_family_name
from .error import SpaceObjShallNotBeUpdated, DictConsistencyError
from .path import Path
@ -38,9 +38,9 @@ FORCE_REDEFINABLES = ('family', 'follower', 'service', 'disknod', 'variables')
# RougailObjSpace's elements that shall be forced to the UnRedefinable type
FORCE_UNREDEFINABLES = ('value',)
# RougailObjSpace's elements that shall not be modify
UNREDEFINABLE = ('multi', 'type')
UNREDEFINABLE = ('multi', 'type',)
# RougailObjSpace's elements that did not created automaticly
FORCE_ELEMENTS = ('choice', 'property_', 'leadership', 'information')
FORCE_ELEMENTS = ('property_', 'information')
# XML text are convert has name
FORCED_TEXT_ELTS_AS_NAME = ('choice', 'property', 'value',)
@ -197,7 +197,7 @@ class RougailObjSpace:
if child.tag == 'family':
if child.attrib['name'] in family_names:
msg = _(f'Family "{child.attrib["name"]}" is set several times')
raise DictConsistencyError(msg, 44, xmlfile)
raise DictConsistencyError(msg, 44, [xmlfile])
family_names.append(child.attrib['name'])
try:
# variable objects creation
@ -296,6 +296,7 @@ class RougailObjSpace:
"""A redefinable object could be created or updated
"""
existed_var = self.get_existed_obj(name,
xmlfile,
space,
child,
namespace,
@ -337,6 +338,7 @@ class RougailObjSpace:
def get_existed_obj(self,
name: str,
xmlfile: str,
space: str,
child,
namespace: str,
@ -344,7 +346,7 @@ class RougailObjSpace:
"""if an object exists, return it
"""
if child.tag in ['variable', 'family']:
name = normalize_family(name)
valid_variable_family_name(name, [xmlfile])
if child.tag == 'variable': # pylint: disable=E1101
if namespace != self.rougailconfig['variable_namespace']:
name = space.path + '.' + name
@ -391,7 +393,7 @@ class RougailObjSpace:
for attr, val in child.attrib.items():
if redefine and attr in UNREDEFINABLE:
msg = _(f'cannot redefine attribute "{attr}" for variable "{child.attrib["name"]}"'
f' in "{xmlfile}", already defined')
f' already defined')
raise DictConsistencyError(msg, 48, variableobj.xmlfiles[:-1])
if attr in self.booleans_attributs:
val = convert_boolean(val)
@ -408,6 +410,12 @@ class RougailObjSpace:
"""Rougail object tree manipulations
"""
if child.tag == 'variable':
if child.attrib.get('remove_choice', False):
if variableobj.type != 'choice':
msg = _(f'cannot remove choices for variable "{variableobj.path}"'
f' the variable has type "{variableobj.type}"')
raise DictConsistencyError(msg, 33, variableobj.xmlfiles)
variableobj.choice = []
if child.attrib.get('remove_check', False):
self.remove_check(variableobj.name)
if child.attrib.get('remove_condition', False):
@ -422,6 +430,7 @@ class RougailObjSpace:
def remove_check(self, name):
"""Remove a check with a specified target
"""
if hasattr(self.space.constraints, 'check'):
remove_checks = []
for idx, check in enumerate(self.space.constraints.check): # pylint: disable=E1101
for target in check.target:
@ -468,20 +477,25 @@ class RougailObjSpace:
"""
if isinstance(variableobj, self.variable): # pylint: disable=E1101
if 'name' in document.attrib:
family_name = normalize_family(document.attrib['name'])
family_name = document.attrib['name']
else:
family_name = namespace
if isinstance(space, self.family) and space.leadership:
leader = space.path
else:
leader = None
self.paths.add_variable(namespace,
normalize_family(variableobj.name),
variableobj.name,
space.path,
document.attrib.get('dynamic') is not None,
variableobj,
leader,
)
elif isinstance(variableobj, self.family): # pylint: disable=E1101
family_name = normalize_family(variableobj.name)
family_name = variableobj.name
if namespace != self.rougailconfig['variable_namespace']:
family_name = namespace + '.' + family_name
family_name = space.path + '.' + family_name
self.paths.add_family(namespace,
family_name,
variableobj,
@ -502,8 +516,6 @@ class RougailObjSpace:
if isinstance(variableobj, Redefinable):
name = variableobj.name
tag = FORCE_TAG.get(child.tag, child.tag)
if child.tag in ['family', 'variable']:
name = normalize_family(name)
getattr(space, tag)[name] = variableobj
elif isinstance(variableobj, UnRedefinable):
getattr(space, child.tag).append(variableobj)

View File

@ -77,19 +77,6 @@ class Path:
)
variableobj.path = full_name
def add_leadership(self,
namespace: str,
path: str,
variableobj: str,
) -> str: # pylint: disable=C0111
"""add a new leadership
"""
self.families[path] = dict(name=path,
namespace=namespace,
variableobj=variableobj,
)
variableobj.path = path
def get_family(self,
name: str,
current_namespace: str,
@ -109,26 +96,6 @@ class Path:
raise DictConsistencyError(msg, 38, [])
return dico['variableobj']
# Leadership
def set_leader(self,
namespace: str,
leader_family_name: str,
leadership_name: str,
name: str,
) -> None: # pylint: disable=C0111
"""set a variable a leadership member
"""
# need rebuild path and move object in new path
old_path = leader_family_name + '.' + name
leadership_path = leader_family_name + '.' + leadership_name
new_path = leadership_path + '.' + name
self.variables[new_path] = self.variables.pop(old_path)
self.variables[new_path]['leader'] = leadership_path
self.variables[new_path]['variableobj'].path = new_path
self.variables[new_path]['family'] = leadership_path
if namespace == self.variable_namespace:
self.full_paths_variables[name] = new_path
def is_leader(self, path): # pylint: disable=C0111
"""Is the variable is a leader
"""
@ -136,7 +103,7 @@ class Path:
if not variable['leader']:
return False
leadership = self.get_family(variable['leader'], variable['variableobj'].namespace)
return leadership.variable[0].path == path
return next(iter(leadership.variable.values())).path == path
def is_follower(self, path):
"""Is the variable is a follower
@ -145,7 +112,7 @@ class Path:
if not variable['leader']:
return False
leadership = self.get_family(variable['leader'], variable['variableobj'].namespace)
return leadership.variable[0].path != path
return next(iter(leadership.variable.values())).path != path
# Variable
def add_variable(self, # pylint: disable=R0913
@ -154,6 +121,7 @@ class Path:
family: str,
is_dynamic: bool,
variableobj,
leader: 'self.objectspace.family'=None,
) -> str: # pylint: disable=C0111
"""Add a new variable (with path)
"""
@ -169,7 +137,7 @@ class Path:
raise DictConsistencyError(msg, 57, variableobj.xmlfiles)
self.variables[full_path] = dict(name=name,
family=family,
leader=None,
leader=leader,
is_dynamic=is_dynamic,
variableobj=variableobj,
)

View File

@ -34,10 +34,10 @@ from os.path import dirname, join, isfile, isdir, abspath
try:
from tiramisu3 import Config
from tiramisu3 import Config, undefined
from tiramisu3.error import PropertiesOptionError # pragma: no cover
except ModuleNotFoundError: # pragma: no cover
from tiramisu import Config
from tiramisu import Config, undefined
from tiramisu.error import PropertiesOptionError
from ..config import RougailConfig
@ -55,6 +55,11 @@ log = logging.getLogger(__name__)
log.addHandler(logging.NullHandler())
INFORMATIONS = {'files': ['source', 'mode', 'owner', 'group', 'engine', 'included'],
'overrides': ['name', 'source', 'engine'],
}
class RougailLeaderIndex:
"""This object is create when access to a specified Index of the variable
"""
@ -69,12 +74,21 @@ class RougailLeaderIndex:
def __getattr__(self, name):
if name not in self._follower:
raise AttributeError()
raise AttributeError(f'unable to find follower "{name}"')
value = self._follower[name]
if isinstance(value, PropertiesOptionError):
raise AttributeError()
raise AttributeError(f'unable to access to follower "{name}": {value}')
return value
def __getitem__(self, name):
return self.__getattr__(name)
def __contains__(self, name):
if self._follower.__contains__(name):
value = self._follower[name]
return not isinstance(value, PropertiesOptionError)
return False
def __str__(self):
return str(self._value)
@ -108,10 +122,11 @@ class RougailLeader:
For examples: %%leader, %%leader[0].follower1
"""
def __init__(self,
leader_name,
value,
) -> None:
self._value = value
self._follower = {}
self._follower = {leader_name: value}
def __getitem__(self, index):
"""Get a leader.follower at requested index.
@ -136,7 +151,7 @@ class RougailLeader:
def __contains__(self, value):
return self._value.__contains__(value)
async def add_follower(self,
async def _add_follower(self,
config,
name: str,
path: str,
@ -157,19 +172,26 @@ class RougailExtra:
For example %%extra1.family.variable
"""
def __init__(self,
suboption: Dict) -> None:
self.suboption = suboption
suboption: Dict,
) -> None:
self._suboption = suboption
def __getattr__(self,
key: str,
) -> Any:
try:
return self.suboption[key]
return self._suboption[key]
except KeyError:
raise AttributeError
raise AttributeError(f'unable to find extra "{key}"')
def __iter__(self):
return iter(self.suboption.values())
return iter(self._suboption.values())
def items(self):
return self._suboption.items()
def __str__(self):
return f'<extra object with: {self._suboption}>'
class RougailBaseTemplate:
@ -231,8 +253,9 @@ class RougailBaseTemplate:
def instance_file(self,
filevar: Dict,
type: str,
type_: str,
service_name: str,
service_type: str,
) -> None:
"""Run templatisation on one file
"""
@ -241,7 +264,7 @@ class RougailBaseTemplate:
variable = filevar['variable']
else:
variable = None
filenames = filevar['name']
filenames = filevar.get('name')
if not isinstance(filenames, list):
filenames = [filenames]
if variable and not isinstance(variable, list):
@ -253,10 +276,11 @@ class RougailBaseTemplate:
var = variable[idx]
else:
var = None
func = f'_instance_{type}'
func = f'get_data_{type_}'
data = getattr(self, func)(filevar,
filename,
service_name,
service_type,
variable,
idx,
)
@ -283,23 +307,45 @@ class RougailBaseTemplate:
chdir(self.templates_dir)
for option in await self.config.option.list(type='all'):
namespace = await option.option.name()
is_var_namespace = namespace == self.rougailconfig['variable_namespace']
is_variable_namespace = namespace == self.rougailconfig['variable_namespace']
if namespace == 'services':
is_service_namespace = 'root'
else:
is_service_namespace = False
self.rougail_variables_dict[namespace] = await self.load_variables(option,
is_var_namespace,
is_variable_namespace,
is_service_namespace,
)
for template in listdir('.'):
self.prepare_template(template)
for included in (True, False):
for service_obj in await self.config.option('services').list('all'):
service_name = await service_obj.option.name()
service_name = await service_obj.option.description()
service_type = await service_obj.information.get('type', 'service')
if await service_obj.option('activate').value.get() is False:
if included is False:
self.desactive_service(service_name)
self.desactive_service(service_name, service_type)
continue
if not included:
engine = await service_obj.information.get('engine', None)
if engine:
self.instance_file({'engine': engine},
'service',
service_name,
service_type,
)
target_name = await service_obj.information.get('target', None)
if target_name:
self.target_service(service_name,
target_name,
service_type,
engine is None,
)
for fills in await service_obj.list('optiondescription'):
type_ = await fills.option.name()
for fill_obj in await fills.list('all'):
fill = await fill_obj.value.dict()
await self.get_informations(type_, fill, fill_obj)
if 'included' in fill:
if (fill['included'] == 'no' and included is True) or \
(fill['included'] != 'no' and included is False):
@ -307,42 +353,73 @@ class RougailBaseTemplate:
elif included is True:
continue
if fill['activate']:
self.instance_file(fill, type_, service_name)
self.instance_file(fill,
type_,
service_name,
service_type,
)
else:
self.log.debug(_("Instantiation of file '{filename}' disabled"))
self.post_instance_service(service_name)
self.post_instance_service(service_name, service_type)
self.post_instance()
chdir(ori_dir)
async def get_informations(self,
type_: str,
dico: dict,
obj: 'Option',
) -> None:
for key in INFORMATIONS.get(type_, []):
default_key = f'default_{type_}_{key}'
if default_key in RougailConfig:
default_value = RougailConfig[default_key]
else:
default_value = undefined
dico[key] = await obj.information.get(key, default_value)
def desactive_service(self,
service_name: str,
*args,
):
raise NotImplementedError(_('cannot desactivate a service'))
def post_instance_service(self, service_name): # pragma: no cover
def target_service(self,
service_name: str,
*args,
):
raise NotImplementedError(_('cannot use target for the service {service_name}'))
def post_instance_service(self,
*args,
): # pragma: no cover
pass
def post_instance(self): # pragma: no cover
pass
def _instance_ip(self,
def get_data_ip(self,
*args,
) -> None: # pragma: no cover
raise NotImplementedError(_('cannot instanciate this service type ip'))
def _instance_files(self,
def get_data_files(self,
*args,
) -> None: # pragma: no cover
raise NotImplementedError(_('cannot instanciate this service type file'))
def _instance_overrides(self,
def get_data_service(self,
*args,
) -> None: # pragma: no cover
raise NotImplementedError(_('cannot instanciate this service'))
def get_data_overrides(self,
*args,
) -> None: # pragma: no cover
raise NotImplementedError(_('cannot instanciate this service type override'))
async def load_variables(self,
optiondescription,
is_variable_namespace,
is_variable_namespace: str,
is_service_namespace: str,
) -> RougailExtra:
"""Load all variables and set it in RougailExtra objects
"""
@ -352,19 +429,30 @@ class RougailBaseTemplate:
if await option.option.isleadership():
for idx, suboption in enumerate(await option.list('all')):
if idx == 0:
leader = RougailLeader(await suboption.value.get())
leader_name = await suboption.option.name()
leader = RougailLeader(leader_name, await suboption.value.get())
leadership_name = await option.option.name()
if is_variable_namespace:
self.rougail_variables_dict[await suboption.option.name()] = leader
else:
await leader.add_follower(self.config,
await leader._add_follower(self.config,
await suboption.option.name(),
await suboption.option.path(),
)
variables[leader_name] = leader
variables[leadership_name] = leader
else:
if is_service_namespace == 'root':
new_is_service_namespace = 'service_name'
elif is_service_namespace == 'service_name':
new_is_service_namespace = await option.option.name()
elif is_service_namespace in INFORMATIONS:
# remove 's'
new_is_service_namespace = is_service_namespace[:-1]
else:
new_is_service_namespace = is_service_namespace
subfamilies = await self.load_variables(option,
is_variable_namespace,
new_is_service_namespace,
)
variables[await option.option.name()] = subfamilies
else:
@ -379,4 +467,9 @@ class RougailBaseTemplate:
else:
value = await option.value.get()
variables[await option.option.name()] = value
if isinstance(is_service_namespace, str) and is_service_namespace + 's' in INFORMATIONS:
await self.get_informations(is_service_namespace + 's',
variables,
optiondescription,
)
return RougailExtra(variables)

View File

@ -74,6 +74,27 @@ class IsDefined:
return varname in self.context
class CreoleClient():
def get(self, path):
path = path.replace('/', '.')
if path.startswith('.'):
path = path[1:]
if '.' not in path:
return self.context[path]
else:
root, path = path.split('.', 1)
obj = self.context[root]
for var in path.split('.'):
obj = getattr(obj, var)
return obj
def is_empty(data):
if str(data) in ['', '""', "''", "[]", "['']", '[""]', "None"]:
return True
return False
class CheetahTemplate(oriCheetahTemplate):
def __init__(self,
filename: str,
@ -82,7 +103,12 @@ class CheetahTemplate(oriCheetahTemplate):
eosfunc: Dict,
extra_context: Dict,
):
creole_client = CreoleClient()
creole_client.context=context
extra_context['is_defined'] = IsDefined(context)
extra_context['creole_client'] = creole_client
extra_context['is_empty'] = is_empty
extra_context['_creole_filename'] = extra_context['rougail_filename']
super().__init__(filename, source, context, eosfunc, extra_context)

View File

@ -38,9 +38,13 @@ IPAddressDeny=any
"""
ROUGAIL_TMPL_TEMPLATE = """%def display(%%file, %%filename)
ROUGAIL_DEST = '/usr/local/lib'
ROUGAIL_GLOBAL_SYSTEMD_FILE = '/usr/lib/systemd/system'
ROUGAIL_TMPL_TEMPLATE = f"""%def display(%%file, %%filename)
%if %%filename.startswith('/etc/') or %%filename.startswith('/var/') or %%filename.startswith('/srv/')
C %%filename %%file.mode %%file.owner %%file.group - /usr/local/lib%%filename
C %%filename %%file.mode %%file.owner %%file.group - {ROUGAIL_DEST}%%filename
z %%filename - - - - -
%end if
%end def
@ -58,7 +62,8 @@ z %%filename - - - - -
%end if
%end for
%end if
%end for"""
%end for
"""
class RougailSystemdTemplate(RougailBaseTemplate):
@ -69,10 +74,11 @@ class RougailSystemdTemplate(RougailBaseTemplate):
self.ip_per_service = None
super().__init__(config, rougailconfig)
def _instance_files(self,
def get_data_files(self,
filevar: Dict,
destfile: str,
service_name: str,
service_type: str,
variable,
idx: int,
) -> tuple:
@ -87,10 +93,11 @@ class RougailSystemdTemplate(RougailBaseTemplate):
var = None
return tmp_file, None, destfile, var
def _instance_overrides(self,
def get_data_overrides(self,
filevar: Dict,
destfile,
service_name: str,
service_type: str,
*args,
) -> tuple:
source = filevar['source']
@ -98,12 +105,14 @@ class RougailSystemdTemplate(RougailBaseTemplate):
raise FileNotFound(_(f"File {source} does not exist."))
tmp_file = join(self.tmp_dir, source)
service_name = filevar['name']
return tmp_file, None, f'/systemd/system/{service_name}.service.d/rougail.conf', None
destfile = f'/systemd/system/{service_name}.{service_type}.d/rougail.conf'
return tmp_file, None, destfile, None
def _instance_ip(self,
def get_data_ip(self,
filevar: Dict,
ip,
service_name: str,
service_type: str,
var: Any,
idx: int,
*args,
@ -119,19 +128,49 @@ class RougailSystemdTemplate(RougailBaseTemplate):
elif ip:
self.ip_per_service.append(ip)
def get_data_service(self,
servicevar: Dict,
info,
service_name: str,
service_type: str,
*args,
):
filename = f'{service_name}.{service_type}'
tmp_file = join(self.tmp_dir, filename)
var = None
destfile = f'/systemd/system/{filename}'
return tmp_file, None, destfile, var
def desactive_service(self,
service_name: str,
service_type: str,
):
filename = f'{self.destinations_dir}/systemd/system/{service_name}.service'
filename = f'{self.destinations_dir}/systemd/system/{service_name}.{service_type}'
makedirs(dirname(filename), exist_ok=True)
symlink('/dev/null', filename)
def target_service(self,
service_name: str,
target_name: str,
service_type: str,
global_service: str,
):
filename = f'{self.destinations_dir}/systemd/system/{target_name}.target.wants/{service_name}.{service_type}'
makedirs(dirname(filename), exist_ok=True)
if global_service:
source_filename = f'{ROUGAIL_GLOBAL_SYSTEMD_FILE}/{service_name}.{service_type}'
else:
source_filename = f'{ROUGAIL_DEST}/systemd/system/{service_name}.{service_type}'
symlink(source_filename, filename)
def post_instance_service(self,
service_name: str,
service_type: str,
) -> None: # pragma: no cover
if self.ip_per_service is None:
return
destfile = f'/systemd/system/{service_name}.service.d/rougail_ip.conf'
destfile = f'/systemd/system/{service_name}.{service_type}.d/rougail_ip.conf'
destfilename = join(self.destinations_dir, destfile[1:])
makedirs(dirname(destfilename), exist_ok=True)
self.log.info(_(f"creole processing: '{destfilename}'"))

View File

@ -243,7 +243,7 @@ class Common:
):
"""Populate variable parameters
"""
if param.type in ['number', 'boolean', 'nil', 'string', 'port']:
if param.type in ['number', 'boolean', 'nil', 'string', 'port', 'choice']:
value = param.text
if param.type == 'string' and value is not None:
value = self.convert_str(value)
@ -251,7 +251,13 @@ class Common:
if param.type == 'variable':
return self.build_option_param(param)
if param.type == 'information':
return f'ParamInformation("{param.text}", None)'
if hasattr(self.elt, 'multi') and self.elt.multi:
default = []
else:
default = None
return f'ParamInformation("{param.text}", {default})'
if param.type == 'target_information':
return f'ParamSelfInformation("{param.text}", None)'
if param.type == 'suffix':
return 'ParamSuffix()'
if param.type == 'index':
@ -292,11 +298,13 @@ class Variable(Common):
):
if hasattr(self.elt, 'opt'):
keys['opt'] = self.elt.opt.reflector_object.get()
if hasattr(self.elt, 'values'):
values = self.elt.values
if values[0].type == 'calculation':
if hasattr(self.elt, 'choice'):
values = self.elt.choice
if values[0].type == 'variable':
value = values[0].name.reflector_object.get()
keys['values'] = f"Calculation(func.calc_value, Params((ParamOption({value}))))"
elif values[0].type == 'function':
keys['values'] = self.calculation_value(values[0], [])
else:
keys['values'] = str(tuple([val.name for val in values]))
if hasattr(self.elt, 'multi') and self.elt.multi:
@ -307,11 +315,11 @@ class Variable(Common):
if isinstance(value, str):
value = self.convert_str(value)
elif isinstance(value, self.objectspace.value):
value = self.calculation_value(value, [])
value = self.calculation_value(value, [], calc_multi=value.calc_multi)
keys[key] = value
if hasattr(self.elt, 'validators'):
keys['validators'] = '[' + ', '.join([self.calculation_value(val,
['ParamSelfOption()']) for val in self.elt.validators]) + ']'
['ParamSelfOption(whole=False)']) for val in self.elt.validators]) + ']'
for key in ['min_number', 'max_number']:
if hasattr(self.elt, key):
keys[key] = getattr(self.elt, key)
@ -323,6 +331,7 @@ class Variable(Common):
def calculation_value(self,
child,
args,
calc_multi=False,
) -> str:
"""Generate calculated value
"""
@ -334,11 +343,9 @@ class Variable(Common):
for param in child.param:
value = self.populate_param(param)
if not hasattr(param, 'name'):
# args.append(str(value))
new_args.append(str(value))
else:
kwargs.append(f"'{param.name}': " + value)
# ret = f'Calculation(func.{function}, Params((' + ', '.join(args) + ')'
if function == 'valid_network_netmask':
new_args.extend(args)
else:
@ -350,7 +357,10 @@ class Variable(Common):
ret += ')'
if hasattr(child, 'warnings_only'):
ret += f', warnings_only={child.warnings_only}'
return ret + ')'
ret = ret + ')'
if calc_multi:
ret = '[' + ret + ']'
return ret
class Family(Common):
@ -365,7 +375,7 @@ class Family(Common):
if hasattr(self.elt, 'suffixes'):
self.objectspace.has_dyn_option = True
self.object_type = 'ConvertDynOptionDescription'
elif isinstance(self.elt, self.objectspace.leadership):
elif hasattr(self.elt, 'leadership') and self.elt.leadership:
self.object_type = 'Leadership'
else:
self.object_type = 'OptionDescription'
@ -381,5 +391,5 @@ class Family(Common):
) -> None:
if hasattr(self.elt, 'suffixes'):
dyn = self.elt.suffixes.reflector_object.get()
keys['suffixes'] = f"Calculation(func.calc_value, Params((ParamOption({dyn}))))"
keys['suffixes'] = f"Calculation(func.calc_value, Params((ParamOption({dyn}, notraisepropertyerror=True))))"
keys['children'] = '[' + ', '.join([child.get() for child in self.children]) + ']'

View File

@ -25,13 +25,17 @@ from os.path import join, isfile, basename
from os import listdir
from lxml.etree import DTD, parse, XMLParser, XMLSyntaxError # pylint: disable=E0611
from lxml.etree import Element, SubElement, tostring
from ast import parse as ast_parse
from .i18n import _
from .error import UpgradeError
from .utils import normalize_family
from .config import RougailConfig
VERSIONS = {'creole': ['1'],
'rougail': ['0.9'],
'rougail': ['0.9', '0.10'],
}
@ -40,19 +44,28 @@ def get_function_name(root, version):
return f'update_{root}_{version}'
FUNCTION_VERSIONS = [get_function_name(root, version) for root, versions in VERSIONS.items() for version in versions]
FUNCTION_VERSIONS = [(root, version, get_function_name(root, version)) for root, versions in VERSIONS.items() for version in versions]
class RougailUpgrade:
def __init__(self, test=False, upgrade_help=None):
def __init__(self,
test=False,
upgrade_help=None,
rougailconfig: RougailConfig=None,
) -> None:
self.test = test
if upgrade_help is None:
upgrade_help = {}
self.upgrade_help = upgrade_help
if rougailconfig is None:
rougailconfig = RougailConfig
self.rougailconfig = rougailconfig
def load_xml_from_folders(self,
srcfolder: str,
dstfolder: str,
namespace: str,
display: bool=True,
):
"""Loads all the XML files located in the xmlfolders' list
@ -63,6 +76,8 @@ class RougailUpgrade:
for filename in filenames:
xmlsrc = join(srcfolder, filename)
xmldst = join(dstfolder, filename)
if isfile(xmldst):
raise Exception(f'cannot update "{xmlsrc}" destination file "{xmldst}" already exists')
try:
parser = XMLParser(remove_blank_text=True)
document = parse(xmlsrc, parser)
@ -71,12 +86,17 @@ class RougailUpgrade:
root = document.getroot()
search_function_name = get_function_name(root.tag, root.attrib.get('version', '1'))
function_found = False
for function_version in FUNCTION_VERSIONS:
for root_name, version, function_version in FUNCTION_VERSIONS:
if function_found and hasattr(self, function_version):
if display:
print(f' - convert {filename} to version {version}')
upgrade_help = self.upgrade_help.get(function_version, {}).get(filename, {})
root = getattr(self, function_version)(root, upgrade_help)
if upgrade_help.get('remove') is True:
continue
root = getattr(self, function_version)(root, upgrade_help, namespace)
if function_version == search_function_name:
function_found = True
root.attrib['version'] = version
with open(xmldst, 'wb') as xmlfh:
xmlfh.write(tostring(root, pretty_print=True, encoding="UTF-8", xml_declaration=True))
# if
@ -87,13 +107,189 @@ class RougailUpgrade:
# yield xmlfile, document.getroot()
def update_rougail_0_10(self,
root: 'Element',
upgrade_help: dict,
namespace: str,
) -> 'Element':
variables = root.find('variables')
if variables is None:
return root
paths = self._get_path_variables(variables,
namespace == self.rougailconfig['variable_namespace'],
namespace,
)
constraints = root.find('constraints')
# convert schedule and schedulemod
for variable in paths.values():
variable = variable['variable']
if variable.tag != 'variable':
continue
if 'type' in variable.attrib and variable.attrib['type'] in ['schedule', 'schedulemod']:
if variable.attrib['type'] == 'schedule':
choices = ('none', 'daily', 'weekly', 'monthly')
else:
choices = ('pre', 'post')
variable.attrib['type'] = 'choice'
has_value = False
for value in variable:
if value.tag == 'value':
has_value = True
break
for name in choices:
choice = SubElement(variable, 'choice')
choice.text = name
if not has_value:
value = SubElement(variable, 'value')
value.text = choices[0]
variable.attrib['mandatory'] = 'True'
# convert group to leadership
groups = []
if constraints is not None:
for constraint in constraints:
if constraint.tag == 'group':
constraints.remove(constraint)
groups.append(constraint)
for group in groups:
if group.attrib['leader'] in paths:
leader_obj = paths[group.attrib['leader']]
#FIXME name peut avoir "." il faut le virer
#FIXME si extra c'est un follower !
if 'name' in group.attrib:
grpname = group.attrib['name']
if 'description' in group.attrib:
description = group.attrib['description']
else:
description = grpname
else:
grpname = leader_obj['variable'].attrib['name']
if '.' in grpname:
grpname = grpname.rsplit('.', 1)[-1]
if 'description' in group.attrib:
description = group.attrib['description']
elif 'description' in leader_obj['variable'].attrib:
description = leader_obj['variable'].attrib['description']
else:
description = grpname
family = SubElement(leader_obj['parent'], 'family', name=grpname, description=description, leadership="True")
leader_obj['parent'].remove(leader_obj['variable'])
family.append(leader_obj['variable'])
else:
# append in group
follower = next(iter(group))
leader_name = group.attrib['leader']
if '.' in leader_name:
leader_path = leader_name.rsplit('.', 1)[0]
follower_path = leader_path + '.' + follower.text
else:
follower_path = follower.text
obj = paths[follower_path]
family = SubElement(obj['parent'], 'family', name=leader_name, leadership="True")
grpname = leader_name
for follower in group:
leader_name = group.attrib['leader']
if '.' in leader_name:
leader_path = leader_name.rsplit('.', 1)[0]
follower_path = leader_path + '.' + follower.text
else:
follower_path = follower.text
follower_obj = paths[follower_path]
follower_obj['parent'].remove(follower_obj['variable'])
family.append(follower_obj['variable'])
if '.' in follower_path:
new_path = follower_path.rsplit('.', 1)[0] + '.' + grpname + '.' + follower_path.rsplit('.', 1)[1]
paths[new_path] = paths[follower_path]
# convert choice option
valid_enums = []
if constraints is not None:
for constraint in constraints:
if constraint.tag == 'check' and constraint.attrib['name'] == 'valid_enum':
constraints.remove(constraint)
valid_enums.append(constraint)
for valid_enum in valid_enums:
targets = []
for target in valid_enum:
if target.tag != 'target':
continue
if target.text in paths:
# not in paths if it's optional
# but not check it
targets.append(paths[target.text]['variable'])
params = []
function_param = None
for param in valid_enum:
if param.tag != 'param':
continue
if 'type' in param.attrib and param.attrib['type'] == 'function':
function_param = param.text
continue
params.append(param)
first_choice = None
for target in targets:
if function_param is not None:
function = SubElement(target, 'choice', type='function', name=function_param)
for param in params:
if function_param is not None:
function.append(param)
else:
choice = SubElement(target, 'choice')
if first_choice is None:
first_choice = choice
choice.text = param.text
if 'type' not in param.attrib and param.text is None:
choice_type = 'nil'
elif 'type' in param.attrib:
choice_type = param.attrib['type']
elif 'type' in target.attrib:
choice_type = target.attrib['type']
else:
choice_type = 'string'
choice.attrib['type'] = choice_type
has_value = False
for target in targets:
if 'remove_check' in target.attrib:
target.attrib['remove_choice'] = target.attrib['remove_check']
for target in targets:
for value in target:
if value.tag == 'value':
has_value = True
if 'type' in target.attrib:
value.attrib['type'] = target.attrib['type']
if first_choice is not None and not has_value:
value = SubElement(target, 'value')
value.attrib['type'] = first_choice.attrib['type']
value.text = first_choice.text
for target in targets:
if 'remove_choice' not in target.attrib or target.attrib['remove_choice'] != 'True':
target.attrib['type'] = 'choice'
return root
def _get_path_variables(self, variables, is_variable_namespace, path, dico=None):
if dico is None:
dico = {}
for variable in variables:
if not is_variable_namespace and path:
subpath = path + '.'
else:
subpath = ''
if variable.tag not in ['variable', 'family']:
continue
subpath += variable.attrib['name']
if variable.tag == 'family':
self._get_path_variables(variable, is_variable_namespace, subpath, dico)
elif variable.tag == 'variable':
dico[subpath] = {'variable': variable, 'parent': variables}
return dico
def update_rougail_0_9(self,
root: 'Element',
upgrade_help: dict,
namespace: str,
) -> 'Element':
# rename root
root.tag = 'rougail'
root.attrib['version'] = '0.9'
variables_auto_valid_enum = {}
variables_help = {}
families_help = {}
@ -111,6 +307,9 @@ class RougailUpgrade:
if not isinstance(subelement.tag, str):
# XML comment
continue
if subelement.tag == 'family_action':
root.remove(subelement)
continue
for subsubelement in subelement:
if not isinstance(subsubelement.tag, str):
# XML comment
@ -130,16 +329,27 @@ class RougailUpgrade:
if subsubsubelement.attrib['name'] in upgrade_help.get('variables', {}).get('hidden', {}).get('remove', []):
self.remove(subsubsubelement, 'hidden', optional=True)
if subsubsubelement.attrib['name'] in upgrade_help.get('variables', {}).get('mandatory', {}).get('remove', []):
self.remove(subsubsubelement, 'mandatory', optional=True)
variables[subsubsubelement.attrib['name']] = subsubsubelement
self.remove(subsubsubelement, 'mandatory')
if subsubsubelement.attrib['name'] in upgrade_help.get('variables', {}).get('mandatory', {}).get('add', []):
subsubsubelement.attrib['mandatory'] = 'True'
if subsubsubelement.attrib['name'] in upgrade_help.get('variables', {}).get('type', {}):
subsubsubelement.attrib['type'] = upgrade_help.get('variables', {}).get('type', {})[subsubsubelement.attrib['name']]
if namespace == self.rougailconfig['variable_namespace']:
path = subsubsubelement.attrib['name']
npath = normalize_family(subsubsubelement.attrib['name'])
else:
path = namespace + '.' + subsubelement.attrib['name'] + '.' + subsubsubelement.attrib['name']
npath = normalize_family(namespace) + '.' + normalize_family(subsubelement.attrib['name']) + '.' + normalize_family(subsubsubelement.attrib['name'])
variables[path] = subsubsubelement
variables[npath] = subsubsubelement
type = subsubsubelement.attrib.get('type')
if type in ['oui/non', 'yes/no', 'on/off']:
variables_auto_valid_enum.setdefault(subsubsubelement.attrib['type'], []).append(subsubsubelement.attrib['name'])
variables_auto_valid_enum.setdefault(subsubsubelement.attrib['type'], []).append(path)
del subsubsubelement.attrib['type']
elif type == 'hostname_strict':
subsubsubelement.attrib['type'] = 'hostname'
elif type == 'domain_strict':
subsubsubelement.attrib['type'] = 'domain'
elif type in ['domain', 'domain_strict']:
subsubsubelement.attrib['type'] = 'domainname'
elif type == 'string':
del subsubsubelement.attrib['type']
if self.test and subsubsubelement.attrib.get('auto_freeze') == 'True':
@ -153,23 +363,49 @@ class RougailUpgrade:
subsubsubelement.attrib['remove_check'] = 'True'
if subsubsubelement.attrib['name'] in upgrade_help.get('variables', {}).get('mode', {}).get('modify', {}):
subsubsubelement.attrib['mode'] = upgrade_help.get('variables', {}).get('mode', {}).get('modify', {})[subsubsubelement.attrib['name']]
if subsubsubelement.attrib['name'] in upgrade_help.get('variables', {}).get('type', {}).get('modify', {}):
subsubsubelement.attrib['type'] = upgrade_help.get('variables', {}).get('type', {}).get('modify', {})[subsubsubelement.attrib['name']]
type = subsubsubelement.attrib['type']
if subsubsubelement.attrib['name'] in upgrade_help.get('variables', {}).get('test', {}):
subsubsubelement.attrib['test'] = upgrade_help.get('variables', {}).get('test', {})[subsubsubelement.attrib['name']]
# for value in subsubsubelement:
# if value.text is None:
# value.attrib['type'] = 'nil'
if subsubsubelement.attrib['name'] in upgrade_help.get('variables', {}).get('remove_value', []):
for value in subsubsubelement:
subsubsubelement.remove(value)
if subsubsubelement.attrib['name'] != normalize_family(subsubsubelement.attrib['name']):
if "description" not in subsubsubelement.attrib:
subsubsubelement.attrib['description'] = subsubsubelement.attrib['name']
subsubsubelement.attrib['name'] = normalize_family(subsubsubelement.attrib['name'])
elif subsubsubelement.tag == 'param':
if subsubelement.tag == 'check' and subsubelement.attrib['target'] in upgrade_help.get('check', {}).get('remove', []):
continue
type = subsubsubelement.attrib.get('type')
if type == 'eole':
subsubsubelement.attrib['type'] = 'variable'
type = 'variable'
elif type in ('container', 'context', 'python'):
if type == 'python':
subsubsubelement.attrib['type'] = 'function'
if subsubsubelement.text.startswith('range('):
func_ast = ast_parse(subsubsubelement.text)
subsubsubelement.text = 'range'
for arg in func_ast.body[0].value.args:
SubElement(subsubelement, 'param', type='number').text = str(arg.value)
else:
raise Exception(f'{subsubsubelement.text} is not a supported function')
type = 'function'
elif type in ('container', 'context'):
raise UpgradeError(_(f'cannot convert param with type "{type}"'))
if subsubelement.attrib['name'] == 'valid_entier' and not 'type' in subsubsubelement.attrib:
subsubsubelement.attrib['type'] = 'number'
if (not type or type == 'variable') and subsubsubelement.text in upgrade_help.get('variables', {}).get('remove', []):
subsubelement.remove(subsubsubelement)
continue
if subsubelement.attrib['name'] == 'valid_enum' and not type:
if subsubsubelement.attrib.get('name') == 'checkval':
if subsubelement.attrib['target'] in upgrade_help.get('check', {}).get('valid_enums', {}).get('checkval', {}).get('remove', []):
subsubelement.remove(subsubsubelement)
continue
raise UpgradeError(_('checkval in valid_enum is no more supported'))
if subsubsubelement.text.startswith('['):
for val in eval(subsubsubelement.text):
SubElement(subsubelement, 'param').text = str(val)
subsubelement.remove(subsubsubelement)
@ -186,16 +422,18 @@ class RougailUpgrade:
type = subsubsubelement.attrib.get('type')
if type in ['service_accesslist', 'service_restrictionlist', 'interfacelist', 'hostlist']:
subsubelement.remove(subsubsubelement)
# elif self.test and type in ['filelist', 'variable', 'servicelist']:
# subsubsubelement.attrib['optional'] = "True"
elif (not type or type == 'variable') and subsubsubelement.text in upgrade_help.get('variables', {}).get('remove', []):
subsubelement.remove(subsubsubelement)
elif type == 'family' and subsubsubelement.text in upgrade_help.get('families', {}).get('remove', []):
subsubelement.remove(subsubsubelement)
up = upgrade_help.get('targets', {}).get(subsubsubelement.text)
if up:
if 'optional' in up:
subsubsubelement.attrib['optional'] = up['optional']
elif type == 'actionlist':
# for family in root.find('variables'):
# family_list = SubElement(subsubelement, 'target')
# family_list.attrib['type'] = 'family'
# family_list.text = namespace + '.' + family.attrib['name']
subsubelement.remove(subsubsubelement)
if upgrade_help.get('targets', {}).get(subsubsubelement.text, {}).get('optional'):
subsubsubelement.attrib['optional'] = upgrade_help.get('targets', {}).get(subsubsubelement.text, {}).get('optional')
has_target = False
for target in subsubelement:
if target.tag == 'target':
@ -205,7 +443,11 @@ class RougailUpgrade:
subelement.remove(subsubelement)
continue
elif subsubsubelement.tag == 'slave':
if subsubsubelement.text in upgrade_help.get('variables', {}).get('remove', []):
subsubelement.remove(subsubsubelement)
continue
subsubsubelement.tag = 'follower'
subsubsubelement.text = normalize_family(subsubsubelement.text)
if subelement.tag == 'containers':
current_service = self.upgrade_container(subsubsubelement, current_service, files, ips, servicelists, upgrade_help)
subsubelement.remove(subsubsubelement)
@ -244,6 +486,9 @@ class RougailUpgrade:
if subsubelement.tag == 'fill' and subsubelement.attrib['target'] in upgrade_help.get('fills', {}).get('remove', []):
subelement.remove(subsubelement)
continue
if subsubelement.tag == 'check' and subsubelement.attrib['target'] in upgrade_help.get('check', {}).get('remove', []):
subelement.remove(subsubelement)
continue
if subsubelement.attrib['target'] in upgrade_help.get('variables', {}).get('remove', []):
subelement.remove(subsubelement)
continue
@ -277,6 +522,12 @@ class RougailUpgrade:
subelement.remove(subsubelement)
else:
self.move(subsubelement, 'master', 'leader')
for follower in subsubelement:
if '.' in subsubelement.attrib['leader']:
path = subsubelement.attrib['leader'].rsplit('.', 1)[0] + '.' + follower.text
else:
path = follower.text
self.remove(variables[path], 'multi', optional=True)
if subsubelement.attrib['leader'] in upgrade_help.get('groups', {}).get('reorder', {}):
for follower in subsubelement:
subsubelement.remove(follower)
@ -296,6 +547,10 @@ class RougailUpgrade:
continue
if subsubelement.attrib['name'] in upgrade_help.get('families', {}).get('hidden', {}).get('add', []):
subsubelement.attrib['hidden'] = 'True'
if subsubelement.attrib['name'] != normalize_family(subsubelement.attrib['name']):
if "description" not in subsubelement.attrib:
subsubelement.attrib['description'] = subsubelement.attrib['name']
subsubelement.attrib['name'] = normalize_family(subsubelement.attrib['name'])
families[subsubelement.attrib['name']] = subsubelement
# if empty, remove
if is_empty(subelement) or subelement.tag in ['containers', 'files', 'help']:
@ -388,7 +643,9 @@ class RougailUpgrade:
for name, text in variables_help.items():
variables[name].attrib['help'] = text
for name, text in families_help.items():
families[name].attrib['help'] = text
if name in upgrade_help.get('families', {}).get('rename', {}):
name = upgrade_help.get('families', {}).get('rename', {})[name]
families[normalize_family(name)].attrib['help'] = text
for auto in autos:
if auto in variables:
variables[auto].attrib['hidden'] = 'True'
@ -430,6 +687,8 @@ class RougailUpgrade:
service.attrib['name'] = service_name
if service_name == 'unknown':
service.attrib['manage'] = 'False'
if service_name in upgrade_help.get('services', {}).get('unmanage', []):
service.attrib['manage'] = 'False'
service_elt[service_name] = service
if upgrade_help.get('servicelists', {}).get(service_name):
service.attrib['servicelist'] = upgrade_help.get('servicelists', {}).get(service_name)
@ -444,7 +703,15 @@ class RougailUpgrade:
elt.attrib['engine'] = 'creole_legacy'
if (not 'instance_mode' in elt.attrib or elt.attrib['instance_mode'] != 'when_container') and \
elt.text not in upgrade_help.get('files', {}).get('remove', {}):
files[current_service][elt.text] = elt
if elt.attrib.get('filelist') in upgrade_help.get('services', {}).get('filelist_service', {}):
elt_service = upgrade_help.get('services', {}).get('filelist_service', {})[elt.attrib['filelist']]
if elt_service in files:
service = elt_service
else:
service = current_service
else:
service = current_service
files[service][elt.text] = elt
elif elt.tag in ['host', 'disknod', 'fstab', 'interface', 'package', 'service_access']:
pass
elif elt.tag == 'service_restriction':
@ -452,7 +719,15 @@ class RougailUpgrade:
if restriction.tag == 'ip' and restriction.text != '0.0.0.0':
self.remove(restriction, 'ip_type', optional=True)
self.remove(restriction, 'netmask_type', optional=True)
ips[current_service].append(restriction)
if elt.attrib['service'] in upgrade_help.get('services', {}).get('rename', {}):
elt_service = upgrade_help.get('services', {}).get('rename', {})[elt.attrib['service']]
else:
elt_service = elt.attrib['service']
if elt_service in ips:
service = elt_service
else:
service = current_service
ips[service].append(restriction)
elif elt.tag == 'service':
new_name = elt.text
if current_service == 'unknown':

View File

@ -26,10 +26,26 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
"""
from typing import List
from unicodedata import normalize, combining
import re
from importlib.machinery import SourceFileLoader
from importlib.util import spec_from_loader, module_from_spec
from .i18n import _
from .error import DictConsistencyError
NAME_REGEXP = re.compile(r"^[a-z0-9_]*$")
def valid_variable_family_name(name: str,
xmlfiles: List[str],
) -> None:
match = NAME_REGEXP.search(name)
if not match:
msg = _(f'invalid variable or family name "{name}" must only contains '
'lowercase ascii character, number or _')
raise DictConsistencyError(msg, 76, xmlfiles)
def normalize_family(family_name: str) -> str:
"""replace space, accent, uppercase, ... by valid character

View File

@ -1,5 +1,5 @@
<?xml version='1.0' encoding='UTF-8'?>
<rougail version="0.9">
<rougail version="0.10">
<services>
<service name="tata">
</service>

View File

@ -1,5 +1,5 @@
<?xml version='1.0' encoding='UTF-8'?>
<rougail version="0.9">
<rougail version="0.10">
<variables>
<variable name="myvar" auto_freeze="True">
<value>no</value>
@ -9,5 +9,3 @@
</variable>
</variables>
</rougail>
<!-- vim: ts=4 sw=4 expandtab
-->

View File

@ -1,5 +1,5 @@
<?xml version='1.0' encoding='UTF-8'?>
<rougail version="0.9">
<rougail version="0.10">
<variables>
<variable name="my_var" auto_freeze="True" mode="expert">
<value>no</value>
@ -9,5 +9,3 @@
</variable>
</variables>
</rougail>
<!-- vim: ts=4 sw=4 expandtab
-->

View File

@ -1,13 +1,11 @@
<?xml version='1.0' encoding='UTF-8'?>
<rougail version="0.9">
<rougail version="0.10">
<variables>
<variable name="server_deployed" type="boolean"/>
<family name="général">
<family name="general" description="général">
<variable name="mode_conteneur_actif" type="string" description="No change" auto_save="True">
<value>non</value>
</variable>
</family>
</variables>
</rougail>
<!-- vim: ts=4 sw=4 expandtab
-->

View File

@ -1,13 +1,11 @@
<?xml version='1.0' encoding='UTF-8'?>
<rougail version="0.9">
<rougail version="0.10">
<variables>
<variable name="server_deployed" type="boolean"/>
<family name="général">
<family name="general" description="général">
<variable name="mode_conteneur_actif" type="string" description="No change" auto_save="True" mode="expert">
<value>non</value>
</variable>
</family>
</variables>
</rougail>
<!-- vim: ts=4 sw=4 expandtab
-->

View File

@ -1,7 +1,7 @@
<?xml version='1.0' encoding='UTF-8'?>
<rougail version="0.9">
<rougail version="0.10">
<variables>
<family name="général">
<family name="general" description="général">
<!-- this is a comment -->
<variable name="mode_conteneur_actif" type="string" description="No change" hidden="True">
<value>non</value>
@ -9,5 +9,3 @@
</family>
</variables>
</rougail>
<!-- vim: ts=4 sw=4 expandtab
-->

View File

@ -1,7 +1,7 @@
<?xml version='1.0' encoding='UTF-8'?>
<rougail version="0.9">
<rougail version="0.10">
<variables>
<family name="général">
<family name="general" description="général">
<variable name="mode_conteneur_actif" type="string" description="No change" hidden="True">
<value>non</value>
</variable>
@ -11,5 +11,3 @@
</family>
</variables>
</rougail>
<!-- vim: ts=4 sw=4 expandtab
-->

View File

@ -1,12 +1,10 @@
<?xml version='1.0' encoding='UTF-8'?>
<rougail version="0.9">
<rougail version="0.10">
<variables>
<family name="général">
<family name="general" description="général">
<variable name="mode_conteneur_actif" type="string" description="No change" hidden="True">
<value>non</value>
</variable>
</family>
</variables>
</rougail>
<!-- vim: ts=4 sw=4 expandtab
-->

View File

@ -1,12 +1,10 @@
<?xml version='1.0' encoding='UTF-8'?>
<rougail version="0.9">
<rougail version="0.10">
<variables>
<family name="général">
<family name="general" description="général">
<variable name="mode_conteneur_actif" type="string" description="No change" hidden="True">
<value>non</value>
</variable>
</family>
</variables>
</rougail>
<!-- vim: ts=4 sw=4 expandtab
-->

View File

@ -1,13 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<rougail version="0.9">
<?xml version='1.0' encoding='UTF-8'?>
<rougail version="0.10">
<variables>
<family name='général'>
<variable name='mode_conteneur_actif1' type='string' description="No change" hidden="True">
<family name="general" description="général">
<variable name="mode_conteneur_actif1" type="string" description="No change" hidden="True">
<value>non</value>
</variable>
</family>
</variables>
</rougail>
<!-- vim: ts=4 sw=4 expandtab
-->

View File

@ -1,5 +1,5 @@
<?xml version='1.0' encoding='UTF-8'?>
<rougail version="0.9">
<rougail version="0.10">
<variables>
<variable name="server_deployed" type="boolean">
<value>no</value>
@ -15,5 +15,3 @@
</fill>
</constraints>
</rougail>
<!-- vim: ts=4 sw=4 expandtab
-->

View File

@ -1,5 +1,5 @@
<?xml version='1.0' encoding='UTF-8'?>
<rougail version="0.9">
<rougail version="0.10">
<variables>
<family name="general">
<variable name="mode_conteneur_actif" type="string" description="No change" hidden="True">
@ -10,7 +10,6 @@
</variable>
</family>
</variables>
<constraints>
<fill name="calc_val">
<param type="variable">mode_conteneur_actif1</param>
@ -18,5 +17,3 @@
</fill>
</constraints>
</rougail>
<!-- vim: ts=4 sw=4 expandtab
-->

View File

@ -1,5 +1,5 @@
<?xml version='1.0' encoding='UTF-8'?>
<rougail version="0.9">
<rougail version="0.10">
<variables>
<family name="general">
<variable name="mode_conteneur_actif" type="string" description="No change" hidden="True">
@ -10,12 +10,9 @@
</variable>
</family>
</variables>
<constraints>
<fill name="calc_val">
<target>mode_conteneur_actif</target>
</fill>
</constraints>
</rougail>
<!-- vim: ts=4 sw=4 expandtab
-->

View File

@ -1,12 +1,10 @@
<?xml version='1.0' encoding='UTF-8'?>
<rougail version="0.9">
<rougail version="0.10">
<variables>
<family name="general">
<variable name="domain" type="domain" description="Description">
<variable name="domain" type="domainname" description="Description">
<value>my.domain.name</value>
</variable>
</family>
</variables>
</rougail>
<!-- vim: ts=4 sw=4 expandtab
-->

View File

@ -1,13 +1,11 @@
<?xml version='1.0' encoding='UTF-8'?>
<rougail version="0.9">
<rougail version="0.10">
<services>
<service name="test">
<file>/etc/file</file>
<file engine="jinja2">/etc/file2</file>
</service>
</services>
<variables>
<family name="general">
<variable name="mode_conteneur_actif" type="string" description="Description">
@ -16,5 +14,3 @@
</family>
</variables>
</rougail>
<!-- vim: ts=4 sw=4 expandtab
-->

View File

@ -3,66 +3,18 @@
"owner": "default",
"value": "non"
},
"services.test.files.file.engine": {
"owner": "default",
"value": "creole"
},
"services.test.files.file.group": {
"owner": "default",
"value": "root"
},
"services.test.files.file.included": {
"owner": "default",
"value": "no"
},
"services.test.files.file.mode": {
"owner": "default",
"value": "0644"
},
"services.test.files.file.name": {
"owner": "default",
"value": "/etc/file"
},
"services.test.files.file.owner": {
"owner": "default",
"value": "root"
},
"services.test.files.file.source": {
"owner": "default",
"value": "file"
},
"services.test.files.file.activate": {
"owner": "default",
"value": true
},
"services.test.files.file2.engine": {
"owner": "default",
"value": "jinja2"
},
"services.test.files.file2.group": {
"owner": "default",
"value": "root"
},
"services.test.files.file2.included": {
"owner": "default",
"value": "no"
},
"services.test.files.file2.mode": {
"owner": "default",
"value": "0644"
},
"services.test.files.file2.name": {
"owner": "default",
"value": "/etc/file2"
},
"services.test.files.file2.owner": {
"owner": "default",
"value": "root"
},
"services.test.files.file2.source": {
"owner": "default",
"value": "file2"
},
"services.test.files.file2.activate": {
"owner": "default",
"value": true

View File

@ -1,20 +1,8 @@
{
"rougail.general.mode_conteneur_actif": "non",
"services.test.files.file.engine": "creole",
"services.test.files.file.group": "root",
"services.test.files.file.included": "no",
"services.test.files.file.mode": "0644",
"services.test.files.file.name": "/etc/file",
"services.test.files.file.owner": "root",
"services.test.files.file.source": "file",
"services.test.files.file.activate": true,
"services.test.files.file2.engine": "jinja2",
"services.test.files.file2.group": "root",
"services.test.files.file2.included": "no",
"services.test.files.file2.mode": "0644",
"services.test.files.file2.name": "/etc/file2",
"services.test.files.file2.owner": "root",
"services.test.files.file2.source": "file2",
"services.test.files.file2.activate": true,
"services.test.activate": true,
"services.test.manage": true

View File

@ -3,66 +3,18 @@
"owner": "default",
"value": "non"
},
"services.test.files.file.engine": {
"owner": "default",
"value": "creole"
},
"services.test.files.file.group": {
"owner": "default",
"value": "root"
},
"services.test.files.file.included": {
"owner": "default",
"value": "no"
},
"services.test.files.file.mode": {
"owner": "default",
"value": "0644"
},
"services.test.files.file.name": {
"owner": "default",
"value": "/etc/file"
},
"services.test.files.file.owner": {
"owner": "default",
"value": "root"
},
"services.test.files.file.source": {
"owner": "default",
"value": "file"
},
"services.test.files.file.activate": {
"owner": "default",
"value": true
},
"services.test.files.file2.engine": {
"owner": "default",
"value": "jinja2"
},
"services.test.files.file2.group": {
"owner": "default",
"value": "root"
},
"services.test.files.file2.included": {
"owner": "default",
"value": "no"
},
"services.test.files.file2.mode": {
"owner": "default",
"value": "0644"
},
"services.test.files.file2.name": {
"owner": "default",
"value": "/etc/file2"
},
"services.test.files.file2.owner": {
"owner": "default",
"value": "root"
},
"services.test.files.file2.source": {
"owner": "default",
"value": "file2"
},
"services.test.files.file2.activate": {
"owner": "default",
"value": true

View File

@ -14,27 +14,18 @@ except:
option_3 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"}))
option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"}))
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2])
option_8 = StrOption(name="engine", doc="engine", default="creole")
option_9 = StrOption(name="group", doc="group", default="root")
option_10 = StrOption(name="included", doc="included", default="no")
option_11 = StrOption(name="mode", doc="mode", default="0644")
option_12 = FilenameOption(name="name", doc="name", default="/etc/file")
option_13 = StrOption(name="owner", doc="owner", default="root")
option_14 = StrOption(name="source", doc="source", default="file")
option_15 = BoolOption(name="activate", doc="activate", default=True)
option_7 = OptionDescription(name="file", doc="file", children=[option_8, option_9, option_10, option_11, option_12, option_13, option_14, option_15])
option_17 = StrOption(name="engine", doc="engine", default="jinja2")
option_18 = StrOption(name="group", doc="group", default="root")
option_19 = StrOption(name="included", doc="included", default="no")
option_20 = StrOption(name="mode", doc="mode", default="0644")
option_21 = FilenameOption(name="name", doc="name", default="/etc/file2")
option_22 = StrOption(name="owner", doc="owner", default="root")
option_23 = StrOption(name="source", doc="source", default="file2")
option_24 = BoolOption(name="activate", doc="activate", default=True)
option_16 = OptionDescription(name="file2", doc="file2", children=[option_17, option_18, option_19, option_20, option_21, option_22, option_23, option_24])
option_6 = OptionDescription(name="files", doc="files", children=[option_7, option_16])
option_25 = BoolOption(name="activate", doc="activate", default=True)
option_26 = BoolOption(name="manage", doc="manage", default=True)
option_5 = OptionDescription(name="test", doc="test", children=[option_6, option_25, option_26])
option_8 = FilenameOption(name="name", doc="name", default="/etc/file")
option_9 = BoolOption(name="activate", doc="activate", default=True)
option_7 = OptionDescription(name="file", doc="file", children=[option_8, option_9])
option_7.impl_set_information('source', "file")
option_11 = FilenameOption(name="name", doc="name", default="/etc/file2")
option_12 = BoolOption(name="activate", doc="activate", default=True)
option_10 = OptionDescription(name="file2", doc="file2", children=[option_11, option_12])
option_10.impl_set_information('engine', "jinja2")
option_10.impl_set_information('source', "file2")
option_6 = OptionDescription(name="files", doc="files", children=[option_7, option_10])
option_13 = BoolOption(name="activate", doc="activate", default=True)
option_14 = BoolOption(name="manage", doc="manage", default=True)
option_5 = OptionDescription(name="test", doc="test", children=[option_6, option_13, option_14])
option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"}))
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4])

View File

@ -1,13 +1,11 @@
<?xml version='1.0' encoding='UTF-8'?>
<rougail version="0.9">
<rougail version="0.10">
<services>
<service name="test">
<file>/etc/file</file>
<file engine="jinja2">/etc/file2</file>
</service>
</services>
<variables>
<family name="general">
<variable name="mode_conteneur_actif" type="string" description="Description">
@ -16,5 +14,3 @@
</family>
</variables>
</rougail>
<!-- vim: ts=4 sw=4 expandtab
-->

View File

@ -3,66 +3,18 @@
"owner": "default",
"value": "non"
},
"services.test.files.file.engine": {
"owner": "default",
"value": "creole"
},
"services.test.files.file.group": {
"owner": "default",
"value": "root"
},
"services.test.files.file.included": {
"owner": "default",
"value": "no"
},
"services.test.files.file.mode": {
"owner": "default",
"value": "0644"
},
"services.test.files.file.name": {
"owner": "default",
"value": "/etc/file"
},
"services.test.files.file.owner": {
"owner": "default",
"value": "root"
},
"services.test.files.file.source": {
"owner": "default",
"value": "file"
},
"services.test.files.file.activate": {
"owner": "default",
"value": true
},
"services.test.files.file2.engine": {
"owner": "default",
"value": "jinja2"
},
"services.test.files.file2.group": {
"owner": "default",
"value": "root"
},
"services.test.files.file2.included": {
"owner": "default",
"value": "no"
},
"services.test.files.file2.mode": {
"owner": "default",
"value": "0644"
},
"services.test.files.file2.name": {
"owner": "default",
"value": "/etc/file2"
},
"services.test.files.file2.owner": {
"owner": "default",
"value": "root"
},
"services.test.files.file2.source": {
"owner": "default",
"value": "file2"
},
"services.test.files.file2.activate": {
"owner": "default",
"value": true

View File

@ -1,20 +1,8 @@
{
"rougail.general.mode_conteneur_actif": "non",
"services.test.files.file.engine": "creole",
"services.test.files.file.group": "root",
"services.test.files.file.included": "no",
"services.test.files.file.mode": "0644",
"services.test.files.file.name": "/etc/file",
"services.test.files.file.owner": "root",
"services.test.files.file.source": "file",
"services.test.files.file.activate": true,
"services.test.files.file2.engine": "jinja2",
"services.test.files.file2.group": "root",
"services.test.files.file2.included": "no",
"services.test.files.file2.mode": "0644",
"services.test.files.file2.name": "/etc/file2",
"services.test.files.file2.owner": "root",
"services.test.files.file2.source": "file2",
"services.test.files.file2.activate": true,
"services.test.activate": true,
"services.test.manage": true

View File

@ -3,66 +3,18 @@
"owner": "default",
"value": "non"
},
"services.test.files.file.engine": {
"owner": "default",
"value": "creole"
},
"services.test.files.file.group": {
"owner": "default",
"value": "root"
},
"services.test.files.file.included": {
"owner": "default",
"value": "no"
},
"services.test.files.file.mode": {
"owner": "default",
"value": "0644"
},
"services.test.files.file.name": {
"owner": "default",
"value": "/etc/file"
},
"services.test.files.file.owner": {
"owner": "default",
"value": "root"
},
"services.test.files.file.source": {
"owner": "default",
"value": "file"
},
"services.test.files.file.activate": {
"owner": "default",
"value": true
},
"services.test.files.file2.engine": {
"owner": "default",
"value": "jinja2"
},
"services.test.files.file2.group": {
"owner": "default",
"value": "root"
},
"services.test.files.file2.included": {
"owner": "default",
"value": "no"
},
"services.test.files.file2.mode": {
"owner": "default",
"value": "0644"
},
"services.test.files.file2.name": {
"owner": "default",
"value": "/etc/file2"
},
"services.test.files.file2.owner": {
"owner": "default",
"value": "root"
},
"services.test.files.file2.source": {
"owner": "default",
"value": "file2"
},
"services.test.files.file2.activate": {
"owner": "default",
"value": true

View File

@ -14,27 +14,18 @@ except:
option_3 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"}))
option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"}))
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2])
option_8 = StrOption(name="engine", doc="engine", default="creole")
option_9 = StrOption(name="group", doc="group", default="root")
option_10 = StrOption(name="included", doc="included", default="no")
option_11 = StrOption(name="mode", doc="mode", default="0644")
option_12 = FilenameOption(name="name", doc="name", default="/etc/file")
option_13 = StrOption(name="owner", doc="owner", default="root")
option_14 = StrOption(name="source", doc="source", default="file")
option_15 = BoolOption(name="activate", doc="activate", default=True)
option_7 = OptionDescription(name="file", doc="file", children=[option_8, option_9, option_10, option_11, option_12, option_13, option_14, option_15])
option_17 = StrOption(name="engine", doc="engine", default="jinja2")
option_18 = StrOption(name="group", doc="group", default="root")
option_19 = StrOption(name="included", doc="included", default="no")
option_20 = StrOption(name="mode", doc="mode", default="0644")
option_21 = FilenameOption(name="name", doc="name", default="/etc/file2")
option_22 = StrOption(name="owner", doc="owner", default="root")
option_23 = StrOption(name="source", doc="source", default="file2")
option_24 = BoolOption(name="activate", doc="activate", default=True)
option_16 = OptionDescription(name="file2", doc="file2", children=[option_17, option_18, option_19, option_20, option_21, option_22, option_23, option_24])
option_6 = OptionDescription(name="files", doc="files", children=[option_7, option_16])
option_25 = BoolOption(name="activate", doc="activate", default=True)
option_26 = BoolOption(name="manage", doc="manage", default=True)
option_5 = OptionDescription(name="test", doc="test", children=[option_6, option_25, option_26])
option_8 = FilenameOption(name="name", doc="name", default="/etc/file")
option_9 = BoolOption(name="activate", doc="activate", default=True)
option_7 = OptionDescription(name="file", doc="file", children=[option_8, option_9])
option_7.impl_set_information('source', "file")
option_11 = FilenameOption(name="name", doc="name", default="/etc/file2")
option_12 = BoolOption(name="activate", doc="activate", default=True)
option_10 = OptionDescription(name="file2", doc="file2", children=[option_11, option_12])
option_10.impl_set_information('engine', "jinja2")
option_10.impl_set_information('source', "file2")
option_6 = OptionDescription(name="files", doc="files", children=[option_7, option_10])
option_13 = BoolOption(name="activate", doc="activate", default=True)
option_14 = BoolOption(name="manage", doc="manage", default=True)
option_5 = OptionDescription(name="test", doc="test", children=[option_6, option_13, option_14])
option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"}))
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4])

View File

@ -1,6 +1,5 @@
<?xml version='1.0' encoding='UTF-8'?>
<rougail version="0.9">
<rougail version="0.10">
<services>
<service name="test">
<file>/etc/file</file>
@ -8,7 +7,6 @@
<file included="content">/etc/dir/incfile</file>
</service>
</services>
<variables>
<family name="general">
<variable name="mode_conteneur_actif" type="string" description="Description">
@ -17,5 +15,3 @@
</family>
</variables>
</rougail>
<!-- vim: ts=4 sw=4 expandtab
-->

View File

@ -3,98 +3,26 @@
"owner": "default",
"value": "non"
},
"services.test.files.file.engine": {
"owner": "default",
"value": "creole"
},
"services.test.files.file.group": {
"owner": "default",
"value": "root"
},
"services.test.files.file.included": {
"owner": "default",
"value": "no"
},
"services.test.files.file.mode": {
"owner": "default",
"value": "0644"
},
"services.test.files.file.name": {
"owner": "default",
"value": "/etc/file"
},
"services.test.files.file.owner": {
"owner": "default",
"value": "root"
},
"services.test.files.file.source": {
"owner": "default",
"value": "file"
},
"services.test.files.file.activate": {
"owner": "default",
"value": true
},
"services.test.files.file2.engine": {
"owner": "default",
"value": "jinja2"
},
"services.test.files.file2.group": {
"owner": "default",
"value": "root"
},
"services.test.files.file2.included": {
"owner": "default",
"value": "no"
},
"services.test.files.file2.mode": {
"owner": "default",
"value": "0644"
},
"services.test.files.file2.name": {
"owner": "default",
"value": "/etc/file2"
},
"services.test.files.file2.owner": {
"owner": "default",
"value": "root"
},
"services.test.files.file2.source": {
"owner": "default",
"value": "file2"
},
"services.test.files.file2.activate": {
"owner": "default",
"value": true
},
"services.test.files.incfile.engine": {
"owner": "default",
"value": "creole"
},
"services.test.files.incfile.group": {
"owner": "default",
"value": "root"
},
"services.test.files.incfile.included": {
"owner": "default",
"value": "content"
},
"services.test.files.incfile.mode": {
"owner": "default",
"value": "0644"
},
"services.test.files.incfile.name": {
"owner": "default",
"value": "/etc/dir/incfile"
},
"services.test.files.incfile.owner": {
"owner": "default",
"value": "root"
},
"services.test.files.incfile.source": {
"owner": "default",
"value": "incfile"
},
"services.test.files.incfile.activate": {
"owner": "default",
"value": true

View File

@ -1,28 +1,10 @@
{
"rougail.general.mode_conteneur_actif": "non",
"services.test.files.file.engine": "creole",
"services.test.files.file.group": "root",
"services.test.files.file.included": "no",
"services.test.files.file.mode": "0644",
"services.test.files.file.name": "/etc/file",
"services.test.files.file.owner": "root",
"services.test.files.file.source": "file",
"services.test.files.file.activate": true,
"services.test.files.file2.engine": "jinja2",
"services.test.files.file2.group": "root",
"services.test.files.file2.included": "no",
"services.test.files.file2.mode": "0644",
"services.test.files.file2.name": "/etc/file2",
"services.test.files.file2.owner": "root",
"services.test.files.file2.source": "file2",
"services.test.files.file2.activate": true,
"services.test.files.incfile.engine": "creole",
"services.test.files.incfile.group": "root",
"services.test.files.incfile.included": "content",
"services.test.files.incfile.mode": "0644",
"services.test.files.incfile.name": "/etc/dir/incfile",
"services.test.files.incfile.owner": "root",
"services.test.files.incfile.source": "incfile",
"services.test.files.incfile.activate": true,
"services.test.activate": true,
"services.test.manage": true

View File

@ -3,98 +3,26 @@
"owner": "default",
"value": "non"
},
"services.test.files.file.engine": {
"owner": "default",
"value": "creole"
},
"services.test.files.file.group": {
"owner": "default",
"value": "root"
},
"services.test.files.file.included": {
"owner": "default",
"value": "no"
},
"services.test.files.file.mode": {
"owner": "default",
"value": "0644"
},
"services.test.files.file.name": {
"owner": "default",
"value": "/etc/file"
},
"services.test.files.file.owner": {
"owner": "default",
"value": "root"
},
"services.test.files.file.source": {
"owner": "default",
"value": "file"
},
"services.test.files.file.activate": {
"owner": "default",
"value": true
},
"services.test.files.file2.engine": {
"owner": "default",
"value": "jinja2"
},
"services.test.files.file2.group": {
"owner": "default",
"value": "root"
},
"services.test.files.file2.included": {
"owner": "default",
"value": "no"
},
"services.test.files.file2.mode": {
"owner": "default",
"value": "0644"
},
"services.test.files.file2.name": {
"owner": "default",
"value": "/etc/file2"
},
"services.test.files.file2.owner": {
"owner": "default",
"value": "root"
},
"services.test.files.file2.source": {
"owner": "default",
"value": "file2"
},
"services.test.files.file2.activate": {
"owner": "default",
"value": true
},
"services.test.files.incfile.engine": {
"owner": "default",
"value": "creole"
},
"services.test.files.incfile.group": {
"owner": "default",
"value": "root"
},
"services.test.files.incfile.included": {
"owner": "default",
"value": "content"
},
"services.test.files.incfile.mode": {
"owner": "default",
"value": "0644"
},
"services.test.files.incfile.name": {
"owner": "default",
"value": "/etc/dir/incfile"
},
"services.test.files.incfile.owner": {
"owner": "default",
"value": "root"
},
"services.test.files.incfile.source": {
"owner": "default",
"value": "incfile"
},
"services.test.files.incfile.activate": {
"owner": "default",
"value": true

View File

@ -14,36 +14,23 @@ except:
option_3 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"}))
option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"}))
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2])
option_8 = StrOption(name="engine", doc="engine", default="creole")
option_9 = StrOption(name="group", doc="group", default="root")
option_10 = StrOption(name="included", doc="included", default="no")
option_11 = StrOption(name="mode", doc="mode", default="0644")
option_12 = FilenameOption(name="name", doc="name", default="/etc/file")
option_13 = StrOption(name="owner", doc="owner", default="root")
option_14 = StrOption(name="source", doc="source", default="file")
option_8 = FilenameOption(name="name", doc="name", default="/etc/file")
option_9 = BoolOption(name="activate", doc="activate", default=True)
option_7 = OptionDescription(name="file", doc="file", children=[option_8, option_9])
option_7.impl_set_information('source', "file")
option_11 = FilenameOption(name="name", doc="name", default="/etc/file2")
option_12 = BoolOption(name="activate", doc="activate", default=True)
option_10 = OptionDescription(name="file2", doc="file2", children=[option_11, option_12])
option_10.impl_set_information('engine', "jinja2")
option_10.impl_set_information('source', "file2")
option_14 = FilenameOption(name="name", doc="name", default="/etc/dir/incfile")
option_15 = BoolOption(name="activate", doc="activate", default=True)
option_7 = OptionDescription(name="file", doc="file", children=[option_8, option_9, option_10, option_11, option_12, option_13, option_14, option_15])
option_17 = StrOption(name="engine", doc="engine", default="jinja2")
option_18 = StrOption(name="group", doc="group", default="root")
option_19 = StrOption(name="included", doc="included", default="no")
option_20 = StrOption(name="mode", doc="mode", default="0644")
option_21 = FilenameOption(name="name", doc="name", default="/etc/file2")
option_22 = StrOption(name="owner", doc="owner", default="root")
option_23 = StrOption(name="source", doc="source", default="file2")
option_24 = BoolOption(name="activate", doc="activate", default=True)
option_16 = OptionDescription(name="file2", doc="file2", children=[option_17, option_18, option_19, option_20, option_21, option_22, option_23, option_24])
option_26 = StrOption(name="engine", doc="engine", default="creole")
option_27 = StrOption(name="group", doc="group", default="root")
option_28 = StrOption(name="included", doc="included", default="content")
option_29 = StrOption(name="mode", doc="mode", default="0644")
option_30 = FilenameOption(name="name", doc="name", default="/etc/dir/incfile")
option_31 = StrOption(name="owner", doc="owner", default="root")
option_32 = StrOption(name="source", doc="source", default="incfile")
option_33 = BoolOption(name="activate", doc="activate", default=True)
option_25 = OptionDescription(name="incfile", doc="incfile", children=[option_26, option_27, option_28, option_29, option_30, option_31, option_32, option_33])
option_6 = OptionDescription(name="files", doc="files", children=[option_7, option_16, option_25])
option_34 = BoolOption(name="activate", doc="activate", default=True)
option_35 = BoolOption(name="manage", doc="manage", default=True)
option_5 = OptionDescription(name="test", doc="test", children=[option_6, option_34, option_35])
option_13 = OptionDescription(name="incfile", doc="incfile", children=[option_14, option_15])
option_13.impl_set_information('included', "content")
option_13.impl_set_information('source', "incfile")
option_6 = OptionDescription(name="files", doc="files", children=[option_7, option_10, option_13])
option_16 = BoolOption(name="activate", doc="activate", default=True)
option_17 = BoolOption(name="manage", doc="manage", default=True)
option_5 = OptionDescription(name="test", doc="test", children=[option_6, option_16, option_17])
option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"}))
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4])

View File

@ -1,6 +1,5 @@
<?xml version='1.0' encoding='UTF-8'?>
<rougail version="0.9">
<rougail version="0.10">
<services>
<service name="test">
<file>/etc/file</file>
@ -8,7 +7,6 @@
<file included="name">/etc/dir/incfile</file>
</service>
</services>
<variables>
<family name="general">
<variable name="mode_conteneur_actif" type="string" description="Description">
@ -17,5 +15,3 @@
</family>
</variables>
</rougail>
<!-- vim: ts=4 sw=4 expandtab
-->

View File

@ -3,98 +3,26 @@
"owner": "default",
"value": "non"
},
"services.test.files.file.engine": {
"owner": "default",
"value": "creole"
},
"services.test.files.file.group": {
"owner": "default",
"value": "root"
},
"services.test.files.file.included": {
"owner": "default",
"value": "no"
},
"services.test.files.file.mode": {
"owner": "default",
"value": "0644"
},
"services.test.files.file.name": {
"owner": "default",
"value": "/etc/file"
},
"services.test.files.file.owner": {
"owner": "default",
"value": "root"
},
"services.test.files.file.source": {
"owner": "default",
"value": "file"
},
"services.test.files.file.activate": {
"owner": "default",
"value": true
},
"services.test.files.file2.engine": {
"owner": "default",
"value": "jinja2"
},
"services.test.files.file2.group": {
"owner": "default",
"value": "root"
},
"services.test.files.file2.included": {
"owner": "default",
"value": "no"
},
"services.test.files.file2.mode": {
"owner": "default",
"value": "0644"
},
"services.test.files.file2.name": {
"owner": "default",
"value": "/etc/file2"
},
"services.test.files.file2.owner": {
"owner": "default",
"value": "root"
},
"services.test.files.file2.source": {
"owner": "default",
"value": "file2"
},
"services.test.files.file2.activate": {
"owner": "default",
"value": true
},
"services.test.files.incfile.engine": {
"owner": "default",
"value": "creole"
},
"services.test.files.incfile.group": {
"owner": "default",
"value": "root"
},
"services.test.files.incfile.included": {
"owner": "default",
"value": "name"
},
"services.test.files.incfile.mode": {
"owner": "default",
"value": "0644"
},
"services.test.files.incfile.name": {
"owner": "default",
"value": "/etc/dir/incfile"
},
"services.test.files.incfile.owner": {
"owner": "default",
"value": "root"
},
"services.test.files.incfile.source": {
"owner": "default",
"value": "incfile"
},
"services.test.files.incfile.activate": {
"owner": "default",
"value": true

View File

@ -1,28 +1,10 @@
{
"rougail.general.mode_conteneur_actif": "non",
"services.test.files.file.engine": "creole",
"services.test.files.file.group": "root",
"services.test.files.file.included": "no",
"services.test.files.file.mode": "0644",
"services.test.files.file.name": "/etc/file",
"services.test.files.file.owner": "root",
"services.test.files.file.source": "file",
"services.test.files.file.activate": true,
"services.test.files.file2.engine": "jinja2",
"services.test.files.file2.group": "root",
"services.test.files.file2.included": "no",
"services.test.files.file2.mode": "0644",
"services.test.files.file2.name": "/etc/file2",
"services.test.files.file2.owner": "root",
"services.test.files.file2.source": "file2",
"services.test.files.file2.activate": true,
"services.test.files.incfile.engine": "creole",
"services.test.files.incfile.group": "root",
"services.test.files.incfile.included": "name",
"services.test.files.incfile.mode": "0644",
"services.test.files.incfile.name": "/etc/dir/incfile",
"services.test.files.incfile.owner": "root",
"services.test.files.incfile.source": "incfile",
"services.test.files.incfile.activate": true,
"services.test.activate": true,
"services.test.manage": true

View File

@ -3,98 +3,26 @@
"owner": "default",
"value": "non"
},
"services.test.files.file.engine": {
"owner": "default",
"value": "creole"
},
"services.test.files.file.group": {
"owner": "default",
"value": "root"
},
"services.test.files.file.included": {
"owner": "default",
"value": "no"
},
"services.test.files.file.mode": {
"owner": "default",
"value": "0644"
},
"services.test.files.file.name": {
"owner": "default",
"value": "/etc/file"
},
"services.test.files.file.owner": {
"owner": "default",
"value": "root"
},
"services.test.files.file.source": {
"owner": "default",
"value": "file"
},
"services.test.files.file.activate": {
"owner": "default",
"value": true
},
"services.test.files.file2.engine": {
"owner": "default",
"value": "jinja2"
},
"services.test.files.file2.group": {
"owner": "default",
"value": "root"
},
"services.test.files.file2.included": {
"owner": "default",
"value": "no"
},
"services.test.files.file2.mode": {
"owner": "default",
"value": "0644"
},
"services.test.files.file2.name": {
"owner": "default",
"value": "/etc/file2"
},
"services.test.files.file2.owner": {
"owner": "default",
"value": "root"
},
"services.test.files.file2.source": {
"owner": "default",
"value": "file2"
},
"services.test.files.file2.activate": {
"owner": "default",
"value": true
},
"services.test.files.incfile.engine": {
"owner": "default",
"value": "creole"
},
"services.test.files.incfile.group": {
"owner": "default",
"value": "root"
},
"services.test.files.incfile.included": {
"owner": "default",
"value": "name"
},
"services.test.files.incfile.mode": {
"owner": "default",
"value": "0644"
},
"services.test.files.incfile.name": {
"owner": "default",
"value": "/etc/dir/incfile"
},
"services.test.files.incfile.owner": {
"owner": "default",
"value": "root"
},
"services.test.files.incfile.source": {
"owner": "default",
"value": "incfile"
},
"services.test.files.incfile.activate": {
"owner": "default",
"value": true

View File

@ -14,36 +14,23 @@ except:
option_3 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"}))
option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"}))
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2])
option_8 = StrOption(name="engine", doc="engine", default="creole")
option_9 = StrOption(name="group", doc="group", default="root")
option_10 = StrOption(name="included", doc="included", default="no")
option_11 = StrOption(name="mode", doc="mode", default="0644")
option_12 = FilenameOption(name="name", doc="name", default="/etc/file")
option_13 = StrOption(name="owner", doc="owner", default="root")
option_14 = StrOption(name="source", doc="source", default="file")
option_8 = FilenameOption(name="name", doc="name", default="/etc/file")
option_9 = BoolOption(name="activate", doc="activate", default=True)
option_7 = OptionDescription(name="file", doc="file", children=[option_8, option_9])
option_7.impl_set_information('source', "file")
option_11 = FilenameOption(name="name", doc="name", default="/etc/file2")
option_12 = BoolOption(name="activate", doc="activate", default=True)
option_10 = OptionDescription(name="file2", doc="file2", children=[option_11, option_12])
option_10.impl_set_information('engine', "jinja2")
option_10.impl_set_information('source', "file2")
option_14 = FilenameOption(name="name", doc="name", default="/etc/dir/incfile")
option_15 = BoolOption(name="activate", doc="activate", default=True)
option_7 = OptionDescription(name="file", doc="file", children=[option_8, option_9, option_10, option_11, option_12, option_13, option_14, option_15])
option_17 = StrOption(name="engine", doc="engine", default="jinja2")
option_18 = StrOption(name="group", doc="group", default="root")
option_19 = StrOption(name="included", doc="included", default="no")
option_20 = StrOption(name="mode", doc="mode", default="0644")
option_21 = FilenameOption(name="name", doc="name", default="/etc/file2")
option_22 = StrOption(name="owner", doc="owner", default="root")
option_23 = StrOption(name="source", doc="source", default="file2")
option_24 = BoolOption(name="activate", doc="activate", default=True)
option_16 = OptionDescription(name="file2", doc="file2", children=[option_17, option_18, option_19, option_20, option_21, option_22, option_23, option_24])
option_26 = StrOption(name="engine", doc="engine", default="creole")
option_27 = StrOption(name="group", doc="group", default="root")
option_28 = StrOption(name="included", doc="included", default="name")
option_29 = StrOption(name="mode", doc="mode", default="0644")
option_30 = FilenameOption(name="name", doc="name", default="/etc/dir/incfile")
option_31 = StrOption(name="owner", doc="owner", default="root")
option_32 = StrOption(name="source", doc="source", default="incfile")
option_33 = BoolOption(name="activate", doc="activate", default=True)
option_25 = OptionDescription(name="incfile", doc="incfile", children=[option_26, option_27, option_28, option_29, option_30, option_31, option_32, option_33])
option_6 = OptionDescription(name="files", doc="files", children=[option_7, option_16, option_25])
option_34 = BoolOption(name="activate", doc="activate", default=True)
option_35 = BoolOption(name="manage", doc="manage", default=True)
option_5 = OptionDescription(name="test", doc="test", children=[option_6, option_34, option_35])
option_13 = OptionDescription(name="incfile", doc="incfile", children=[option_14, option_15])
option_13.impl_set_information('included', "name")
option_13.impl_set_information('source', "incfile")
option_6 = OptionDescription(name="files", doc="files", children=[option_7, option_10, option_13])
option_16 = BoolOption(name="activate", doc="activate", default=True)
option_17 = BoolOption(name="manage", doc="manage", default=True)
option_5 = OptionDescription(name="test", doc="test", children=[option_6, option_16, option_17])
option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"}))
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4])

View File

@ -1,13 +1,11 @@
<?xml version='1.0' encoding='UTF-8'?>
<rougail version="0.9">
<rougail version="0.10">
<services>
<service name="test">
<file>/etc/file</file>
<file engine="jinja2">/etc/file2</file>
</service>
</services>
<variables>
<family name="general">
<variable name="mode_conteneur_actif" type="string" description="Description">
@ -16,5 +14,3 @@
</family>
</variables>
</rougail>
<!-- vim: ts=4 sw=4 expandtab
-->

View File

@ -3,66 +3,18 @@
"owner": "default",
"value": "non"
},
"services.test.files.file.engine": {
"owner": "default",
"value": "creole"
},
"services.test.files.file.group": {
"owner": "default",
"value": "root"
},
"services.test.files.file.included": {
"owner": "default",
"value": "no"
},
"services.test.files.file.mode": {
"owner": "default",
"value": "0644"
},
"services.test.files.file.name": {
"owner": "default",
"value": "/etc/file"
},
"services.test.files.file.owner": {
"owner": "default",
"value": "root"
},
"services.test.files.file.source": {
"owner": "default",
"value": "file"
},
"services.test.files.file.activate": {
"owner": "default",
"value": true
},
"services.test.files.file2.engine": {
"owner": "default",
"value": "jinja2"
},
"services.test.files.file2.group": {
"owner": "default",
"value": "root"
},
"services.test.files.file2.included": {
"owner": "default",
"value": "no"
},
"services.test.files.file2.mode": {
"owner": "default",
"value": "0644"
},
"services.test.files.file2.name": {
"owner": "default",
"value": "/etc/file2"
},
"services.test.files.file2.owner": {
"owner": "default",
"value": "root"
},
"services.test.files.file2.source": {
"owner": "default",
"value": "file2"
},
"services.test.files.file2.activate": {
"owner": "default",
"value": true

View File

@ -1,20 +1,8 @@
{
"rougail.general.mode_conteneur_actif": "non",
"services.test.files.file.engine": "creole",
"services.test.files.file.group": "root",
"services.test.files.file.included": "no",
"services.test.files.file.mode": "0644",
"services.test.files.file.name": "/etc/file",
"services.test.files.file.owner": "root",
"services.test.files.file.source": "file",
"services.test.files.file.activate": true,
"services.test.files.file2.engine": "jinja2",
"services.test.files.file2.group": "root",
"services.test.files.file2.included": "no",
"services.test.files.file2.mode": "0644",
"services.test.files.file2.name": "/etc/file2",
"services.test.files.file2.owner": "root",
"services.test.files.file2.source": "file2",
"services.test.files.file2.activate": true,
"services.test.activate": true,
"services.test.manage": true

View File

@ -3,66 +3,18 @@
"owner": "default",
"value": "non"
},
"services.test.files.file.engine": {
"owner": "default",
"value": "creole"
},
"services.test.files.file.group": {
"owner": "default",
"value": "root"
},
"services.test.files.file.included": {
"owner": "default",
"value": "no"
},
"services.test.files.file.mode": {
"owner": "default",
"value": "0644"
},
"services.test.files.file.name": {
"owner": "default",
"value": "/etc/file"
},
"services.test.files.file.owner": {
"owner": "default",
"value": "root"
},
"services.test.files.file.source": {
"owner": "default",
"value": "file"
},
"services.test.files.file.activate": {
"owner": "default",
"value": true
},
"services.test.files.file2.engine": {
"owner": "default",
"value": "jinja2"
},
"services.test.files.file2.group": {
"owner": "default",
"value": "root"
},
"services.test.files.file2.included": {
"owner": "default",
"value": "no"
},
"services.test.files.file2.mode": {
"owner": "default",
"value": "0644"
},
"services.test.files.file2.name": {
"owner": "default",
"value": "/etc/file2"
},
"services.test.files.file2.owner": {
"owner": "default",
"value": "root"
},
"services.test.files.file2.source": {
"owner": "default",
"value": "file2"
},
"services.test.files.file2.activate": {
"owner": "default",
"value": true

View File

@ -14,27 +14,18 @@ except:
option_3 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"}))
option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"}))
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2])
option_8 = StrOption(name="engine", doc="engine", default="creole")
option_9 = StrOption(name="group", doc="group", default="root")
option_10 = StrOption(name="included", doc="included", default="no")
option_11 = StrOption(name="mode", doc="mode", default="0644")
option_12 = FilenameOption(name="name", doc="name", default="/etc/file")
option_13 = StrOption(name="owner", doc="owner", default="root")
option_14 = StrOption(name="source", doc="source", default="file")
option_15 = BoolOption(name="activate", doc="activate", default=True)
option_7 = OptionDescription(name="file", doc="file", children=[option_8, option_9, option_10, option_11, option_12, option_13, option_14, option_15])
option_17 = StrOption(name="engine", doc="engine", default="jinja2")
option_18 = StrOption(name="group", doc="group", default="root")
option_19 = StrOption(name="included", doc="included", default="no")
option_20 = StrOption(name="mode", doc="mode", default="0644")
option_21 = FilenameOption(name="name", doc="name", default="/etc/file2")
option_22 = StrOption(name="owner", doc="owner", default="root")
option_23 = StrOption(name="source", doc="source", default="file2")
option_24 = BoolOption(name="activate", doc="activate", default=True)
option_16 = OptionDescription(name="file2", doc="file2", children=[option_17, option_18, option_19, option_20, option_21, option_22, option_23, option_24])
option_6 = OptionDescription(name="files", doc="files", children=[option_7, option_16])
option_25 = BoolOption(name="activate", doc="activate", default=True)
option_26 = BoolOption(name="manage", doc="manage", default=True)
option_5 = OptionDescription(name="test", doc="test", children=[option_6, option_25, option_26])
option_8 = FilenameOption(name="name", doc="name", default="/etc/file")
option_9 = BoolOption(name="activate", doc="activate", default=True)
option_7 = OptionDescription(name="file", doc="file", children=[option_8, option_9])
option_7.impl_set_information('source', "file")
option_11 = FilenameOption(name="name", doc="name", default="/etc/file2")
option_12 = BoolOption(name="activate", doc="activate", default=True)
option_10 = OptionDescription(name="file2", doc="file2", children=[option_11, option_12])
option_10.impl_set_information('engine', "jinja2")
option_10.impl_set_information('source', "file2")
option_6 = OptionDescription(name="files", doc="files", children=[option_7, option_10])
option_13 = BoolOption(name="activate", doc="activate", default=True)
option_14 = BoolOption(name="manage", doc="manage", default=True)
option_5 = OptionDescription(name="test", doc="test", children=[option_6, option_13, option_14])
option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"}))
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4])

View File

@ -1,13 +1,11 @@
<?xml version='1.0' encoding='UTF-8'?>
<rougail version="0.9">
<rougail version="0.10">
<services>
<service name="test">
<file>/etc/systemd-makefs@dev-disk-by\x2dpartlabel</file>
<file engine="jinja2">/etc/systemd-makefs@dev-disk-by\x2dpartlabel2</file>
</service>
</services>
<variables>
<family name="general">
<variable name="mode_conteneur_actif" type="string" description="Description">
@ -16,5 +14,3 @@
</family>
</variables>
</rougail>
<!-- vim: ts=4 sw=4 expandtab
-->

View File

@ -3,66 +3,18 @@
"owner": "default",
"value": "non"
},
"services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel.engine": {
"owner": "default",
"value": "creole"
},
"services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel.group": {
"owner": "default",
"value": "root"
},
"services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel.included": {
"owner": "default",
"value": "no"
},
"services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel.mode": {
"owner": "default",
"value": "0644"
},
"services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel.name": {
"owner": "default",
"value": "/etc/systemd-makefs@dev-disk-by\\x2dpartlabel"
},
"services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel.owner": {
"owner": "default",
"value": "root"
},
"services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel.source": {
"owner": "default",
"value": "systemd-makefs@dev-disk-by\\x2dpartlabel"
},
"services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel.activate": {
"owner": "default",
"value": true
},
"services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel2.engine": {
"owner": "default",
"value": "jinja2"
},
"services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel2.group": {
"owner": "default",
"value": "root"
},
"services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel2.included": {
"owner": "default",
"value": "no"
},
"services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel2.mode": {
"owner": "default",
"value": "0644"
},
"services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel2.name": {
"owner": "default",
"value": "/etc/systemd-makefs@dev-disk-by\\x2dpartlabel2"
},
"services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel2.owner": {
"owner": "default",
"value": "root"
},
"services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel2.source": {
"owner": "default",
"value": "systemd-makefs@dev-disk-by\\x2dpartlabel2"
},
"services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel2.activate": {
"owner": "default",
"value": true

View File

@ -1,20 +1,8 @@
{
"rougail.general.mode_conteneur_actif": "non",
"services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel.engine": "creole",
"services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel.group": "root",
"services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel.included": "no",
"services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel.mode": "0644",
"services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel.name": "/etc/systemd-makefs@dev-disk-by\\x2dpartlabel",
"services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel.owner": "root",
"services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel.source": "systemd-makefs@dev-disk-by\\x2dpartlabel",
"services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel.activate": true,
"services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel2.engine": "jinja2",
"services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel2.group": "root",
"services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel2.included": "no",
"services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel2.mode": "0644",
"services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel2.name": "/etc/systemd-makefs@dev-disk-by\\x2dpartlabel2",
"services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel2.owner": "root",
"services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel2.source": "systemd-makefs@dev-disk-by\\x2dpartlabel2",
"services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel2.activate": true,
"services.test.activate": true,
"services.test.manage": true

View File

@ -3,66 +3,18 @@
"owner": "default",
"value": "non"
},
"services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel.engine": {
"owner": "default",
"value": "creole"
},
"services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel.group": {
"owner": "default",
"value": "root"
},
"services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel.included": {
"owner": "default",
"value": "no"
},
"services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel.mode": {
"owner": "default",
"value": "0644"
},
"services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel.name": {
"owner": "default",
"value": "/etc/systemd-makefs@dev-disk-by\\x2dpartlabel"
},
"services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel.owner": {
"owner": "default",
"value": "root"
},
"services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel.source": {
"owner": "default",
"value": "systemd-makefs@dev-disk-by\\x2dpartlabel"
},
"services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel.activate": {
"owner": "default",
"value": true
},
"services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel2.engine": {
"owner": "default",
"value": "jinja2"
},
"services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel2.group": {
"owner": "default",
"value": "root"
},
"services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel2.included": {
"owner": "default",
"value": "no"
},
"services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel2.mode": {
"owner": "default",
"value": "0644"
},
"services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel2.name": {
"owner": "default",
"value": "/etc/systemd-makefs@dev-disk-by\\x2dpartlabel2"
},
"services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel2.owner": {
"owner": "default",
"value": "root"
},
"services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel2.source": {
"owner": "default",
"value": "systemd-makefs@dev-disk-by\\x2dpartlabel2"
},
"services.test.files.systemd_makefs@dev_disk_by\\x2dpartlabel2.activate": {
"owner": "default",
"value": true

View File

@ -14,27 +14,18 @@ except:
option_3 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"}))
option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"}))
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2])
option_8 = StrOption(name="engine", doc="engine", default="creole")
option_9 = StrOption(name="group", doc="group", default="root")
option_10 = StrOption(name="included", doc="included", default="no")
option_11 = StrOption(name="mode", doc="mode", default="0644")
option_12 = FilenameOption(name="name", doc="name", default="/etc/systemd-makefs@dev-disk-by\\x2dpartlabel")
option_13 = StrOption(name="owner", doc="owner", default="root")
option_14 = StrOption(name="source", doc="source", default="systemd-makefs@dev-disk-by\\x2dpartlabel")
option_15 = BoolOption(name="activate", doc="activate", default=True)
option_7 = OptionDescription(name="systemd_makefs@dev_disk_by\\x2dpartlabel", doc="systemd-makefs@dev-disk-by\\x2dpartlabel", children=[option_8, option_9, option_10, option_11, option_12, option_13, option_14, option_15])
option_17 = StrOption(name="engine", doc="engine", default="jinja2")
option_18 = StrOption(name="group", doc="group", default="root")
option_19 = StrOption(name="included", doc="included", default="no")
option_20 = StrOption(name="mode", doc="mode", default="0644")
option_21 = FilenameOption(name="name", doc="name", default="/etc/systemd-makefs@dev-disk-by\\x2dpartlabel2")
option_22 = StrOption(name="owner", doc="owner", default="root")
option_23 = StrOption(name="source", doc="source", default="systemd-makefs@dev-disk-by\\x2dpartlabel2")
option_24 = BoolOption(name="activate", doc="activate", default=True)
option_16 = OptionDescription(name="systemd_makefs@dev_disk_by\\x2dpartlabel2", doc="systemd-makefs@dev-disk-by\\x2dpartlabel2", children=[option_17, option_18, option_19, option_20, option_21, option_22, option_23, option_24])
option_6 = OptionDescription(name="files", doc="files", children=[option_7, option_16])
option_25 = BoolOption(name="activate", doc="activate", default=True)
option_26 = BoolOption(name="manage", doc="manage", default=True)
option_5 = OptionDescription(name="test", doc="test", children=[option_6, option_25, option_26])
option_8 = FilenameOption(name="name", doc="name", default="/etc/systemd-makefs@dev-disk-by\\x2dpartlabel")
option_9 = BoolOption(name="activate", doc="activate", default=True)
option_7 = OptionDescription(name="systemd_makefs@dev_disk_by\\x2dpartlabel", doc="systemd-makefs@dev-disk-by\\x2dpartlabel", children=[option_8, option_9])
option_7.impl_set_information('source', "systemd-makefs@dev-disk-by\\x2dpartlabel")
option_11 = FilenameOption(name="name", doc="name", default="/etc/systemd-makefs@dev-disk-by\\x2dpartlabel2")
option_12 = BoolOption(name="activate", doc="activate", default=True)
option_10 = OptionDescription(name="systemd_makefs@dev_disk_by\\x2dpartlabel2", doc="systemd-makefs@dev-disk-by\\x2dpartlabel2", children=[option_11, option_12])
option_10.impl_set_information('engine', "jinja2")
option_10.impl_set_information('source', "systemd-makefs@dev-disk-by\\x2dpartlabel2")
option_6 = OptionDescription(name="files", doc="files", children=[option_7, option_10])
option_13 = BoolOption(name="activate", doc="activate", default=True)
option_14 = BoolOption(name="manage", doc="manage", default=True)
option_5 = OptionDescription(name="test", doc="test", children=[option_6, option_13, option_14])
option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"}))
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4])

View File

@ -1,5 +1,5 @@
<?xml version='1.0' encoding='UTF-8'?>
<rougail version="0.9">
<rougail version="0.10">
<variables>
<family name="general">
<variable name="float" type="float" description="Description">
@ -11,5 +11,3 @@
</family>
</variables>
</rougail>
<!-- vim: ts=4 sw=4 expandtab
-->

View File

@ -1,11 +1,9 @@
<?xml version='1.0' encoding='UTF-8'?>
<rougail version="0.9">
<rougail version="0.10">
<variables>
<family name="general">
<variable name="mode_conteneur_actif" type="string" description="Redefine description" help="message with '"/>
<variable name="mode_conteneur_actif1" type="string" description="Redefine description" help='message with "'/>
<variable name="mode_conteneur_actif1" type="string" description="Redefine description" help="message with &quot;"/>
</family>
</variables>
</rougail>
<!-- vim: ts=4 sw=4 expandtab
-->

View File

@ -1,5 +1,5 @@
<?xml version='1.0' encoding='UTF-8'?>
<rougail version="0.9">
<rougail version="0.10">
<variables>
<family name="general">
<variable name="mode_conteneur_actif" type="string" description="Redefine description" hidden="True" multi="True">
@ -8,5 +8,3 @@
</family>
</variables>
</rougail>
<!-- vim: ts=4 sw=4 expandtab
-->

View File

@ -1,5 +1,5 @@
<?xml version='1.0' encoding='UTF-8'?>
<rougail version="0.9">
<rougail version="0.10">
<variables>
<family name="general">
<variable name="mode_conteneur_actif" type="string" description="Redefine description" hidden="True">
@ -8,5 +8,3 @@
</family>
</variables>
</rougail>
<!-- vim: ts=4 sw=4 expandtab
-->

View File

@ -1,5 +1,5 @@
<?xml version='1.0' encoding='UTF-8'?>
<rougail version="0.9">
<rougail version="0.10">
<variables>
<family name="general">
<variable name="mode_conteneur_actif" type="string" description="Redefine description" hidden="True">
@ -8,5 +8,3 @@
</family>
</variables>
</rougail>
<!-- vim: ts=4 sw=4 expandtab
-->

View File

@ -1,5 +1,5 @@
<?xml version='1.0' encoding='UTF-8'?>
<rougail version="0.9">
<rougail version="0.10">
<variables>
<family name="general">
<variable name="mode_conteneur_actif" type="string" description="Redefine description" hidden="True">
@ -8,5 +8,3 @@
</family>
</variables>
</rougail>
<!-- vim: ts=4 sw=4 expandtab
-->

View File

@ -1,5 +1,5 @@
<?xml version='1.0' encoding='UTF-8'?>
<rougail version="0.9">
<rougail version="0.10">
<variables>
<family name="general">
<variable name="mode_conteneur_actif" type="string" description="Redefine description" hidden="True" multi="True">
@ -8,5 +8,3 @@
</family>
</variables>
</rougail>
<!-- vim: ts=4 sw=4 expandtab
-->

View File

@ -1,5 +1,5 @@
<?xml version='1.0' encoding='UTF-8'?>
<rougail version="0.9">
<rougail version="0.10">
<variables>
<family name="general">
<variable name="mode_conteneur_actif" type="string" description="Redefine description" hidden="True" multi="True">
@ -8,5 +8,3 @@
</family>
</variables>
</rougail>
<!-- vim: ts=4 sw=4 expandtab
-->

View File

@ -1,5 +1,5 @@
<?xml version='1.0' encoding='UTF-8'?>
<rougail version="0.9">
<rougail version="0.10">
<variables>
<family name="general">
<variable name="mode_conteneur_actif" type="string" description="Redefine description" hidden="True" multi="True">
@ -8,5 +8,3 @@
</family>
</variables>
</rougail>
<!-- vim: ts=4 sw=4 expandtab
-->

View File

@ -1,5 +1,5 @@
<?xml version='1.0' encoding='UTF-8'?>
<rougail version="0.9">
<rougail version="0.10">
<variables>
<family name="general">
<variable name="mode_conteneur_actif" type="string" description="Redefine description" hidden="True">
@ -8,5 +8,3 @@
</family>
</variables>
</rougail>
<!-- vim: ts=4 sw=4 expandtab
-->

Some files were not shown because too many files have changed in this diff Show More