Compare commits

..

28 Commits

Author SHA1 Message Date
533c70aef2 Merge branch 'develop' into dist/risotto/risotto-2.8.0/develop 2021-05-14 07:01:16 +02:00
ef83c3d257 Merge branch 'develop' into dist/risotto/risotto-2.8.0/develop 2021-05-13 22:32:39 +02:00
254a861472 Merge branch 'develop' into dist/risotto/risotto-2.8.0/develop 2021-04-26 17:56:50 +02:00
84eafb2deb Merge branch 'develop' into dist/risotto/risotto-2.8.0/develop 2021-04-16 09:32:49 +02:00
36827b6869 Merge branch 'develop' into dist/risotto/risotto-2.8.0/develop 2021-04-14 18:00:46 +02:00
a0fd998aeb Merge branch 'develop' into dist/risotto/risotto-2.8.0/develop 2021-04-13 20:00:46 +02:00
4fd5d38ca0 Merge branch 'develop' into dist/risotto/risotto-2.8.0/develop 2021-04-12 16:58:05 +02:00
278fdd339a Merge branch 'develop' into dist/risotto/risotto-2.8.0/develop 2021-04-12 15:04:48 +02:00
0970eee14e Merge branch 'develop' into dist/risotto/risotto-2.8.0/develop 2021-03-28 15:49:59 +02:00
e9596c2e2a Merge branch 'develop' into dist/risotto/risotto-2.8.0/develop 2021-03-27 15:42:06 +01:00
42b67ce575 Merge branch 'develop' into dist/risotto/risotto-2.8.0/develop 2021-03-27 11:08:19 +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
702 changed files with 4527 additions and 6719 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

@ -11,7 +11,6 @@ Rougail est un bibliothèque python3 qui permet de charger des dictionnaires (fi
- [Les dictionnaires](dictionary/rougail.md)
- [Les dictionnaires extra](dictionary/extra.md)
- [Convention d'écriture d'un dictionnaire](dictionary/convention.md)
### Les variables

View File

@ -2,7 +2,7 @@
## Un condition
Les conditions permettent d'ajouter ou de supprimer des propriétés à une [variable](../variable/README.md), une [famille](../family/README.md), un [service](../service/README.md), un [fichier](../service/file.md) ou une [ip](../service/ip.md) suivant le contexte.
Les conditions permettent d'ajouter ou de supprimer des propriétés à une [variable](../variable/README.md), une [famille](../family/README.md), un [service](../service/service.md), un [fichier](../service/file.md) ou une [ip](../service/ip.md) suivant le contexte.
Nous allons nous concentrer ici sur la condition hidden_if_in, mais [il existe d'autre conditions](conditions.md).

View File

@ -16,7 +16,7 @@ Il est possible de désactiver une [variable](../variable/README.md) ou une [fam
## Caché
Il est possible de cacher une [variable](../variable/README.md), une [famille](../family/README.md), un [service](../service/README.md), un [fichier](../service/file.md) ou une [ip](../service/ip.md) avec les conditions :
Il est possible de cacher une [variable](../variable/README.md), une [famille](../family/README.md), un [service](../service/service.md), un [fichier](../service/file.md) ou une [ip](../service/ip.md) avec les conditions :
- hidden_if_in
- hidden_if_not_in

View File

@ -14,12 +14,6 @@ Pour modifier il suffit de faire :
RougailConfig[key] = value
```
## Ajout d'une fonction de conversion
Les fonctions de conversion fait parti du moteur de rougail. Il converti les informations des dictionnaires pour créer des variables Tiramisu.
La clef "extra_annotators" permet d'ajouter des fonctions complémentaires.
## Configuration de chargement des dictionnaires
### Les répertoires des dictionnaires
@ -54,10 +48,7 @@ Pour pouvez changer le répertoire de destination de la DTD et le nom du fichier
### 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". Cette clef peut contenir une liste s'il y a plusieurs fichiers.
Les fonctions doivent retourner une valeur, même si la variable que l'on calcul est une variable multiple.
Si la fonction peut retourner une valeur multiple (une liste), il faut mettre le nom de la fonction dans la clef "multi_functions".
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".
### La variable auto_freeze
@ -86,7 +77,7 @@ Il est possible d'ajouter des fonctions interne via la clef "internal_functions"
### 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". Cette clef peut contenir une liste s'il y a plusieurs répertoires.
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
@ -102,11 +93,6 @@ Le répertoire de temporaire est géré dans la clef "tmp_dir" et a comme valeur
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".
### Le nom du répertoire où se trouve les fichiers pour tmpfile.d
Le répertoire où se trouve les fichiers tmpfile.d sont par défaut dans "/usr/local/lib", il est possible de changer ce répertoire avec la clef "tmpfile_dest_dir".
## La configuration par défaut des fichiers
### Le moteur de templates par défaut
@ -127,6 +113,8 @@ Le groupe propriétaire des fichiers générés est géré dans la clef "default
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 du moteur de templates
## 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

@ -1,13 +0,0 @@
# Convention de rédaction d'un dictionnaire
## Ordonnancement du dictionnaire
L'ordre des informations mise dans le dictionnaire est idéalement :
- services
- variables
- constraintes
## Le nom d'espace
Le nom d'espace dans un dictionnaire est de deux espaces.

View File

@ -4,4 +4,3 @@ Une variable calculée est une variable donc sa valeur est le résultat d'une fo
- [Valeur calculée de la variable](value.md)
- [Réfinition](redefine.md)
- [Exemples de calcule](examples.md)

View File

@ -1,48 +0,0 @@
# Exemples de calcule
## Calculer les noms de modèle à généré à partir d'une variable
Créeons deux variables multiples, une pour accueillir la liste des éléments du nom variable (ici `zones_list`), la seconde étant le nom du fichier calculé (ici `netwokd_configurations`) :
```
<variables>
<variable name="zones_list" type="string" multi="True">
<value>zone1</value>
<value>zone2</value>
<value>zone3</value>
</variable>
<variable name="netwokd_configurations" type="filename" multi="True" hidden="True"/>
</variables>
```
Calculons la valeur de la seconde variable à partir de la première :
```
<constraints>
<fill name="calc_value">
<param>/systemd/network/10-</param>
<param type="variable">zones_list</param>
<param>-risotto.network</param>
<param name="join"></param>
<param name="multi" type="boolean">True</param>
<target>netwokd_configurations</target>
</fill>
</constraints>
```
Le contenu de la variable `netwokd_configurations` sera alors :
- /systemd/netword/10-zone1/risotto.network
- /systemd/netword/10-zone2/risotto.network
- /systemd/netword/10-zone3/risotto.network
Enfin déclarer une balise file en utilisant ces deux variables :
```
<services>
<service name="systemd-networkd">
<file file_type="variable" source="network" variable="zones_list">netwokd_configurations</file>
</service>
</services>
```

View File

@ -42,11 +42,3 @@ Le paramètre peut être une valeur null (None en python) :
```
<param type="nil"/>
```
# Paramètre de type "space"
Les paramètres sont chargés en supprimer les espaces en début ou fin de chaîne. Ce qui rend impossible d'avoir un paramètre " ". Avec le type "space", le paramètre sera donc un simple espace :
```
<param type="space"/>
```

View File

@ -1,107 +1,4 @@
# La gestion d'un service
# Les services
## La base service
Un service est inclut dans un conteneur [services](../services.md).
Cette balise permet de définir tous les éléments ([fichier](file.md), [IP](ip.md) et [réécriture](override.md)) liés à un service ou à démon.
Il faut, à la création du service, préciser son nom :
```
<?xml version='1.0' encoding='UTF-8'?>
<rougail>
<services>
<service name="squid"/>
</services>
</rougail>
```
## Les types de service
Les services peuvent être de plusieurs type :
- service (valeur par défaut) : cela signifie que c'est un service systemd qui est activer au démarrage de la machine
- mount : fichier utilisé par systemd-mount
- swap : fichier utilisé par systemd-swap
- timer : tâche planifié pour systemd
```
<service name="dev-disk-by\x2dpartlabel-swap" type="swap"/>
```
## Les targets de service
Active le service systemd pour une target systemd déterminé. Par défaut, l'activation du service n'est pas gérer par rougail.
```
<service name="squid" target="multi-user"/>
```
## La génération du fichier service
Le fichier de description du service peut être fourni directement par la distribution GNU/Linux utilisé, mais il peut également être fournit par l'administrateur.
Dans ce cas, il est possible de créé un template, dont le nom est obligatoirement la valeur de la balise "name" + "." + la valeur de la base "type".
Deux types de template sont aujourd'hui disponible :
- creole
- jinja2
```
<service name="dev-disk-by\x2dpartlabel-swap" type="swap" engine="creole"/>
```
Dans ce cas, rougail utilisera le template "dev-disk-by\x2dpartlabel-swap.swap" pour générer le fichier systemd de gestion de ce service.
## Le service factice
Un service peut être factice, donc non géré par le système de service du système :
```
<service name="ldap_client" manage="False"/>
```
Un service factice est généralement une service qui n'existe pas réellement (par exemple si on configure un client). Il n'est là que pour contenir des fichiers.
## Désactiver le 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, le service et les éléments qu'il compose ([fichier](file.md), [IP](ip.md) et [réécriture](override.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 :
```
<services>
<service name="test" servicelist="test">
</service>
</services>
<variables>
<variable name="condition" type="boolean"/>
</variables>
<constraints>
<condition name="disabled_if_in" source="condition">
<param>False</param>
<target type="servicelist">test</target>
</condition>
</constraints>
```
Dans ce cas, tous les services et les éléments qu'il compose avec un attribut servicelist à "test" seront désactivés si la variable "condition" est False.
## Ne pas désactiver le service dans systemd
La désactivation du service va créé un lien symbolique vers /dev/null.
Si vous ne voulez juste pas créé le fichier de service et ne pas faire de lien symbolique, il faut utiliser l'attribut undisable :
```
<service name="test" disabled="True" undisable="True"/>
```

View File

@ -2,7 +2,7 @@
## La balise file
La gestion des fichiers se fait dans un conteneur de [service](README.md).
La gestion des fichiers se fait dans un conteneur de [service](service.md).
La déclaration du fichier permet de générer un fichier à partir d'un template pour le déposer à l'endroit prévu dans la déclaration de cette élément.
@ -89,7 +89,7 @@ En effet, il est possible de passer le contenu d'une variable au template :
</variables>
```
Dans ce cas, lors de la génération du fichier /etc/squid1/squid.conf on retrouvera la variable "rougail_variable" avec la valeur "squid1" et la variable "rougail_index" avec la valeur "0". Lors de la génération du fichier /etc/squid2/squid.conf on retrouvera la variable "rougail_variable" avec la valeur "squid2" et la variable "rougail_index" avec la valeur "1".
Dans ce cas, lors de la génération du fichier /etc/squid1/squid.conf on retrouvera la variable "rougail_variable" avec la valeur "squid1" et le fichier /etc/squid2/squid.conf on retrouvera la variable "rougail_variable" avec la valeur "squid2".
Attention : les deux variables "my_variable1" et "my_variable2" doivent être multiple et de même longueur.
@ -107,13 +107,7 @@ Il est possible de personnaliser les droits par défaut dans la [configuration d
## Désactiver la génération d'un fichier
Il est possible de désactiver la génération d'un fichier avec l'attribut "disabled" :
```
<file disabled="True">/etc/squid/squid.conf</file>
```
Il est aussi possible de définir une [condition](../condition/README.md) de type "disabled_if_in" ou "disabled_if_not_in" sur une balise 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 :
```
<services>
@ -168,82 +162,13 @@ Un attribut "included" permet de définir la nature du fichier. Cet attribut peu
- "name" : le répertoire de destination est listé dans un autre template, il faut que le fichier soit généré avant cet autre template
- "content" : le contenu du fichier est copié dans un autre template, il faut que le fichier soit généré avant cet autre template et ce fichier n'a pas besoin d'être installé sur le serveur cible.
Exemples :
```
<file included="name">/etc/squid/squid.conf</file>
<file included="content">/etc/squid/squid.conf</file>
```
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)
Exemples :
- créons un template qui inclut des noms de fichiers :
Le contenu de ce template (squid.conf) est :
```
%import os
%set %%confdir = 'etc/squid/squid.d/'
%if %%os.path.exists(%%confdir)
%set %%files = %%os.listdir(%%confdir)
%%files.sort()
%for %%file in %%files
%if %%file.endswith('.cfg')
include '/' + %%confdir + file
%end if
%end for
%end if
```
Ajoutons un second template (squid.included.conf) qui sera copié dans ce répertoire :
```
template content
```
Et déclaront ces deux templates :
```
<file>/etc/squid/squid.conf</file>
<file included="name" engine="none">/etc/squid/squid.d/squid.conf</file>
```
Le contenu du fichier généré (/etc/squid/squid.conf) sera donc :
```
include squid.d/squid.conf
```
- créons un template qui inclut le contenu de fichiers :
Le contenu de ce template (squid.conf) est :
```
%import os
%set %%confdir = 'squid.d/'
%if %%os.path.exists(%%confdir)
%set %%files = %%os.listdir(%%confdir)
%%files.sort()
%for %%file in %%files
%if %%file.endswith('.cfg')
%include raw %%confdir + file
%end if
%end for
%end if
```
Ajoutons un second template (squid.included.conf) qui sera copié dans ce répertoire :
```
template content
```
Et déclaront ces deux templates :
```
<file>/etc/squid/squid.conf</file>
<file included="content" engine="none">squid.d/squid.conf</file>
```
Le contenu du fichier généré (/etc/squid/squid.conf) sera donc maintenant :
```
template content
```

View File

@ -2,7 +2,7 @@
## La balise IP
La gestion des IP se fait dans un conteneur de [service](README.md).
La gestion des IP se fait dans un conteneur de [service](service.md).
La déclaration de l'attribut permet d'associer une IP autorisé à accéder au service.

View File

@ -1,8 +1,8 @@
# Réécriture du service
# Override
## La balise override
La gestion des overrides se fait dans un conteneur de [service](README.md).
La gestion des overrides se fait dans un conteneur de [service](service.md).
La balise override permet de redéfinir facilement un service systemd.

60
doc/service/service.md Normal file
View File

@ -0,0 +1,60 @@
# La gestion d'un service
## La base service
Un service est inclut dans un conteneur [services](../services.md).
Cette balise permet de définir tous les éléments ([fichier](file.md), [IP](ip.md), ...) liés à un service ou à démon.
Il faut, à la création du service, préciser son nom :
```
<?xml version='1.0' encoding='UTF-8'?>
<rougail>
<services>
<service name="squid"/>
</services>
</rougail>
```
Un service peut ne pas être géré :
```
<service name="squid" manage="True"/>
```
Un service non géré est généralement une service qui n'existe pas réellement (par exemple si on configure un client).
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 :
```
<services>
<service name="test">
</service>
</services>
<variables>
<variable name="condition" type="boolean"/>
</variables>
<constraints>
<condition name="disabled_if_in" source="condition">
<param>False</param>
<target type="servicelist">test</target>
</condition>
</constraints>
```
Dans ce cas, tous les services et les éléments qu'il compose ([fichier](file.md), ...) avec un attribut servicelist à "test" seront désactivés si la variable "condition" est False.

View File

@ -1,6 +1,6 @@
# Le conteneur des services
La balise "services" est le conteneur de l'ensemble des [services](service/README.md).
La balise "services" est le conteneur de l'ensemble des [services](service/service.md).
Il est placé à la racine du dictionnaire :

View File

@ -4,7 +4,7 @@
### servicelist
Une cible peut être de type [service](../service/README.md) :
Une cible peut être de type [service](../service/service.md) :
```
<target type="servicelist">example</target>

View File

@ -39,7 +39,7 @@ Une variable a un type. Ce type permet de définir les valeurs acceptées par ce
- 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
- secret (ou password mais est obsolète) : un secret (comme un mot de passe, une clef privée, ...)
- 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")
@ -152,9 +152,7 @@ Attention trois attributs ne sont redéfinisable :
Créons notre variable :
```
<variable name="my_variable"/>
```
Et redéfinisons là :
@ -254,22 +252,3 @@ Pour définir le [mode](../mode.md) :
```
<variable name="my_variable" mode="expert"/>
```
## Les variables qui fournissent des valeurs
Il peut être intéressant de retrouver facilement des variables sans connaitre le chemin complet mais en utilisant le contenu du paramètre "provider".
C'est particulièrement utile si un service peut être fournit par plusieurs services. Les variables n'auront donc pas le même nom. Utiliser ce paramètre, permet donc de retrouver facilement la variable.
Pour déclarer :
```
<variable name="my_variable" provider="my_function"/>
```
Dans le code de l'application, on pourra retrouver le chemin de la variable en faisant :
```
print(await config.information.get('provider:my_function'))
```
Pour les variables inclusent dans une famille dynamique, le chemin de la variable sera un template comme ceci "rougail.family_{suffix}.my_variable_{suffix}". Il vous suffit de remplacer "{suffix}" par le suffix voulu de la famille dynamique.

View File

@ -60,17 +60,6 @@ Il est possible d'en définit d'autres :
</constraints>
```
## Faire un calcul avec l'index de la variable meneuse
Dans un calcul sur un variable suiveuse il est possible de récupérer l'index de la variable meneuse :
```
<fill name="calc_val">
<param type="index"/>
<target>follower</target>
</fill>
```
## Définition des variables meneuse et suiveuse dans un dictionnaire extra
Voici un exemple de définition d'une variable meneuse et de deux variables meneuses dans un espace de nom "example" :

View File

@ -64,30 +64,19 @@ def get_annotators(annotators, module_name):
class SpaceAnnotator: # pylint: disable=R0903
"""Transformations applied on a object instance
"""
def __init__(self,
objectspace,
eosfunc_files,
):
def __init__(self, objectspace, eosfunc_file):
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)
for extra_annotator in objectspace.rougailconfig['extra_annotators']:
if extra_annotator not in 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)
functions = []
for eosfunc_file in eosfunc_files:
functions.extend(dir(load_modules(eosfunc_file)))
for annotator in annotators:
annotator(objectspace,
functions,
)
annotator(objectspace, eosfunc_file)
__all__ = ('SpaceAnnotator', 'CONVERT_OPTION')

View File

@ -25,11 +25,11 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
"""
from typing import List, Any
from copy import copy
from rougail.annotator.target import TargetAnnotator
from rougail.annotator.param import ParamAnnotator
from rougail.utils import load_modules
from rougail.i18n import _
from rougail.error import DictConsistencyError, display_xmlfiles
@ -41,7 +41,7 @@ class Annotator(TargetAnnotator, ParamAnnotator):
level = 40
def __init__(self,
objectspace,
functions,
eosfunc_file,
*args,
):
if not hasattr(objectspace.space, 'constraints') or \
@ -50,7 +50,7 @@ class Annotator(TargetAnnotator, ParamAnnotator):
self.objectspace = objectspace
self.let_none = True
self.only_variable = True
self.functions = copy(functions)
self.functions = dir(load_modules(eosfunc_file))
self.functions.extend(INTERNAL_FUNCTIONS)
self.functions.extend(self.objectspace.rougailconfig['internal_functions'])
self.target_is_uniq = False
@ -99,8 +99,6 @@ class Annotator(TargetAnnotator, ParamAnnotator):
if param.type != 'number':
msg = _(f'param in "valid_entier" must be an "integer", not "{param.type}"')
raise DictConsistencyError(msg, 18, check.xmlfiles)
if not hasattr(param, 'name'):
continue
for target in check.target:
if param.name == 'mini':
target.name.min_number = int(param.text)

View File

@ -268,7 +268,7 @@ class Annotator(Walk):
for family in self.get_families():
if 'dynamic' not in vars(family):
continue
family.suffixes = self.objectspace.paths.get_variable(family.dynamic, family.xmlfiles)
family.suffixes = self.objectspace.paths.get_variable(family.dynamic)
del family.dynamic
if not family.suffixes.multi:
msg = _(f'dynamic family "{family.name}" must be linked '

View File

@ -24,7 +24,7 @@ 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 copy import copy
from rougail.utils import load_modules
from rougail.i18n import _
from rougail.error import DictConsistencyError
@ -32,7 +32,7 @@ from rougail.annotator.target import TargetAnnotator
from rougail.annotator.param import ParamAnnotator
CALC_MULTI = ('calc_value', 'calc_list', 'get_range', 'calc_val_first_value', 'unbound_filename', 'zone_information', 'get_certificates', 'nsd_filename', 'get_linked_configuration', 'get_internal_zones', 'nsd_concat_lists', 'get_internal_info_in_zone')
CALC_MULTI = ('calc_value', 'calc_list', 'get_range', 'calc_val_first_value', 'unbound_filename')
class Annotator(TargetAnnotator, ParamAnnotator):
@ -41,17 +41,15 @@ class Annotator(TargetAnnotator, ParamAnnotator):
level = 60
def __init__(self,
objectspace,
functions,
eosfunc_file,
*args,
):
if not hasattr(objectspace.space, 'constraints') or \
not hasattr(objectspace.space.constraints, 'fill'):
return
self.objectspace = objectspace
self.functions = copy(functions)
self.functions = dir(load_modules(eosfunc_file))
self.functions.extend(self.objectspace.rougailconfig['internal_functions'])
self.calc_multi = list(CALC_MULTI)
self.calc_multi.extend(self.objectspace.rougailconfig['multi_functions'])
self.target_is_uniq = True
self.only_variable = True
self.allow_function = False
@ -81,7 +79,7 @@ class Annotator(TargetAnnotator, ParamAnnotator):
value = self.objectspace.value(fill.xmlfiles)
value.type = 'calculation'
value.name = fill.name
if fill.name not in self.calc_multi:
if fill.name not in CALC_MULTI:
is_calc_multi = self.calc_is_multi(target.name)
else:
is_calc_multi = False

View File

@ -59,7 +59,7 @@ class ParamAnnotator:
if param.type in ['suffix', 'index']:
msg = _(f'"{param.type}" parameter must not have a value')
raise DictConsistencyError(msg, 28, obj.xmlfiles)
if param.type in ['nil', 'space']:
if param.type == 'nil':
if param.text is not None:
msg = _(f'"{param.type}" parameter must not have a value')
raise DictConsistencyError(msg, 40, obj.xmlfiles)
@ -102,11 +102,8 @@ class ParamAnnotator:
if param.type == 'suffix':
for target in obj.target:
if not self.objectspace.paths.variable_is_dynamic(target.name.path):
target_name = target.name
if isinstance(target_name, self.objectspace.variable):
target_name = target_name.name
msg = _(f'"{param.type}" parameter cannot be set with target '
f'"{target_name}" which is not a dynamic variable')
f'"{target.name}" which is not a dynamic variable')
raise DictConsistencyError(msg, 53, obj.xmlfiles)
elif param.type == 'index':
for target in obj.target:
@ -116,9 +113,6 @@ class ParamAnnotator:
raise DictConsistencyError(msg, 60, obj.xmlfiles)
elif param.type == 'nil':
param.text = None
elif param.type == 'space':
param.type = 'string'
param.text = ' '
elif param.type == 'string':
param.text = ''
if variable_type:

View File

@ -56,13 +56,11 @@ class Annotator(Walk):
# hidden variable is also frozen
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 and \
not hasattr(variable, 'provider'):
if not variable.auto_freeze:
variable.frozen = True
if not variable.auto_save and \
not variable.auto_freeze and \
'force_default_on_freeze' not in vars(variable) and \
not hasattr(variable, 'provider'):
'force_default_on_freeze' not in vars(variable):
variable.force_default_on_freeze = True
if not hasattr(variable, 'properties'):
variable.properties = []

View File

@ -33,7 +33,7 @@ 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', 'namespace', 'xmlfiles', 'disabled', 'name', 'manage')
ERASED_ATTRIBUTES2 = ('redefine', 'namespace', 'xmlfiles', 'disabled')
ERASED_ATTRIBUTES2 = ('redefine', 'namespace', 'xmlfiles')
ALLOW_ATTRIBUT_NOT_MANAGE = ['file', 'engine', 'target']
@ -115,7 +115,6 @@ class Annotator:
if not hasattr(service, 'information'):
service.information = self.objectspace.information(service.xmlfiles)
setattr(service.information, elttype, values)
service.path = '.'.join(['services', service.name])
manage = self._generate_element('boolean',
None,
None,
@ -153,15 +152,11 @@ class Annotator:
elt.xmlfiles,
)
family.variable = []
if hasattr(elt, 'disabled'):
disabled = elt.disabled
else:
disabled = False
activate_obj = self._generate_element('boolean',
None,
None,
'activate',
not disabled,
True,
elt,
'.'.join([subpath, 'activate']),
)
@ -253,7 +248,7 @@ class Annotator:
variable.mode = None
variable.type = type_
if type_ == 'symlink':
variable.opt = self.objectspace.paths.get_variable(value, xmlfiles=elt.xmlfiles)
variable.opt = self.objectspace.paths.get_variable(value)
variable.multi = None
needed_type = self.objectspace.types[dtd_key_type]
if needed_type not in ('variable', variable.opt.type):
@ -285,7 +280,7 @@ class Annotator:
self.uniq_overrides.append(service_name)
override.name = service_name
if not hasattr(override, 'source'):
override.source = service_name
override.source = f'{service_name}.service'
@staticmethod
def _update_file(file_,

View File

@ -35,7 +35,6 @@ CONVERT_OPTION = {'number': dict(opttype="IntOption", func=int),
'choice': dict(opttype="ChoiceOption"),
'string': dict(opttype="StrOption"),
'password': dict(opttype="PasswordOption"),
'secret': dict(opttype="PasswordOption"),
'mail': dict(opttype="EmailOption"),
'boolean': dict(opttype="BoolOption", func=convert_boolean),
'symlink': dict(opttype="SymLinkOption"),
@ -163,8 +162,6 @@ class Annotator(Walk): # pylint: disable=R0903
raise DictConsistencyError(msg, 5, choice.xmlfiles)
if choice.type == 'nil':
choice.name = None
elif choice.type == 'space':
choice.name = ' '
elif choice.type == 'variable':
choice.name = self.objectspace.paths.get_variable(choice.name)
if not choice.name.multi:

View File

@ -40,11 +40,9 @@ RougailConfig = {'dictionaries_dir': [join(ROUGAILROOT, 'dictionaries')],
'tmp_dir': join(ROUGAILROOT, 'tmp'),
'dtdfilename': join(DTDDIR, 'rougail.dtd'),
'functions_file': join(ROUGAILROOT, 'functions.py'),
'tmpfile_dest_dir': '/usr/local/lib',
'variable_namespace': 'rougail',
'auto_freeze_variable': 'server_deployed',
'internal_functions': [],
'multi_functions': [],
'extra_annotators': [],
'modes_level': ['basic', 'normal', 'expert'],
'default_family_mode': 'basic',

View File

@ -79,14 +79,11 @@ class RougailConvert:
extra_dir,
)
functions_file = rougailconfig['functions_file']
if not isinstance(functions_file, list):
functions_file = [functions_file]
SpaceAnnotator(rougailobjspace,
functions_file,
)
self.output = TiramisuReflector(rougailobjspace,
functions_file,
rougailconfig['internal_functions'],
).get_text() + '\n'
@staticmethod

View File

@ -53,8 +53,7 @@
<!ATTLIST service disabled (True|False) "False">
<!ATTLIST service engine (none|creole|jinja2) #IMPLIED>
<!ATTLIST service target CDATA #IMPLIED>
<!ATTLIST service type (service|mount|swap|timer) "service">
<!ATTLIST service undisable (True|False) "False">
<!ATTLIST service type (service|mount) "service">
<!ELEMENT ip (#PCDATA)>
<!ATTLIST ip iplist CDATA #IMPLIED>
@ -69,14 +68,11 @@
<!ATTLIST file source CDATA #IMPLIED>
<!ATTLIST file mode CDATA #IMPLIED>
<!ATTLIST file owner CDATA #IMPLIED>
<!ATTLIST file owner_type (unix_user|variable) "unix_user">
<!ATTLIST file group CDATA #IMPLIED>
<!ATTLIST file group_type (unix_user|variable) "unix_user">
<!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) #IMPLIED>
<!ATTLIST file disabled (True|False) "False">
<!ELEMENT override EMPTY>
<!ATTLIST override source CDATA #IMPLIED>
@ -92,10 +88,11 @@
<!ATTLIST family hidden (True|False) "False">
<!ATTLIST family dynamic CDATA #IMPLIED>
<!ATTLIST family leadership (True|False) "False">
<!ATTLIST family provider CDATA #IMPLIED>
<!ELEMENT variable ((choice*|value*)*)>
<!ATTLIST variable name CDATA #REQUIRED>
<!ATTLIST variable type (number|float|string|password|secret|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 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">
@ -115,10 +112,10 @@
<!ATTLIST variable test CDATA #IMPLIED>
<!ELEMENT value (#PCDATA)>
<!ATTLIST value type (string|number|nil|space|boolean) #IMPLIED>
<!ATTLIST value type (string|number|nil|boolean) #IMPLIED>
<!ELEMENT choice (#PCDATA | param)*>
<!ATTLIST choice type (string|number|nil|space|boolean|function|variable) "string">
<!ATTLIST choice type (string|number|nil|boolean|function|variable) "string">
<!ATTLIST choice name CDATA #IMPLIED>
<!ELEMENT constraints ((fill*|check*|condition*)*)>
@ -137,7 +134,7 @@
<!ATTLIST condition apply_on_fallback (True|False) #IMPLIED>
<!ELEMENT param (#PCDATA)>
<!ATTLIST param type (string|number|nil|space|boolean|variable|function|information|target_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">

View File

@ -179,7 +179,6 @@ class RougailObjSpace:
self.space,
namespace,
redefine_variables,
False,
)
def _xml_parse(self, # pylint: disable=R0913
@ -188,15 +187,10 @@ class RougailObjSpace:
space,
namespace,
redefine_variables,
is_dynamic,
) -> None:
# var to check unique family name in a XML file
family_names = []
for child in document:
if is_dynamic:
is_sub_dynamic = True
else:
is_sub_dynamic = document.attrib.get('dynamic') is not None
if not isinstance(child.tag, str):
# doesn't proceed the XML commentaries
continue
@ -231,7 +225,6 @@ class RougailObjSpace:
document,
variableobj,
space,
is_sub_dynamic,
)
self.add_to_tree_structure(variableobj,
space,
@ -244,7 +237,6 @@ class RougailObjSpace:
variableobj,
namespace,
redefine_variables,
is_sub_dynamic,
)
def get_variableobj(self,
@ -286,8 +278,6 @@ class RougailObjSpace:
) -> Optional[str]:
if child.tag == 'variables':
return namespace
if child.tag == 'service':
return child.attrib['name'] + '.' + child.attrib.get('type', 'service')
if 'name' in child.attrib:
return child.attrib['name']
if child.text and child.tag in self.forced_text_elts_as_name:
@ -482,7 +472,6 @@ class RougailObjSpace:
document,
variableobj,
space,
is_dynamic,
):
"""Fill self.paths attributes
"""
@ -499,7 +488,7 @@ class RougailObjSpace:
self.paths.add_variable(namespace,
variableobj.name,
space.path,
is_dynamic,
document.attrib.get('dynamic') is not None,
variableobj,
leader,
)

View File

@ -125,8 +125,6 @@ class Path:
) -> str: # pylint: disable=C0111
"""Add a new variable (with path)
"""
if name == 'hostname_' and not is_dynamic:
raise Exception('pffff')
if '.' not in name:
full_path = '.'.join([family, name])
if namespace == self.variable_namespace:
@ -176,7 +174,6 @@ class Path:
)
namespace = dico['variableobj'].namespace
if namespace not in [self.variable_namespace, 'services'] and \
current_namespace != 'services' and \
current_namespace != namespace:
msg = _(f'A variable located in the "{namespace}" namespace shall not be used '
f'in the "{current_namespace}" namespace')

View File

@ -29,7 +29,7 @@ from shutil import copy
import logging
from typing import Dict, Any
from subprocess import call
from os import listdir, makedirs, getcwd, chdir, unlink, rmdir
from os import listdir, makedirs, getcwd, chdir
from os.path import dirname, join, isfile, isdir, abspath
@ -55,12 +55,9 @@ log = logging.getLogger(__name__)
log.addHandler(logging.NullHandler())
INFORMATIONS = {'files': ['source', 'mode', 'engine', 'included'],
INFORMATIONS = {'files': ['source', 'mode', 'owner', 'group', 'engine', 'included'],
'overrides': ['name', 'source', 'engine'],
}
DEFAULT = {'files': ['owner', 'group'],
'overrides': [],
}
class RougailLeaderIndex:
@ -187,11 +184,6 @@ class RougailExtra:
except KeyError:
raise AttributeError(f'unable to find extra "{key}"')
def __getitem__(self,
key: str,
) -> Any:
return self.__getattr__(key)
def __iter__(self):
return iter(self._suboption.values())
@ -199,10 +191,7 @@ class RougailExtra:
return self._suboption.items()
def __str__(self):
suboptions = {}
for key, value in self._suboption.items():
suboptions[key] = str(value)
return f'<extra object with: {suboptions}>'
return f'<extra object with: {self._suboption}>'
class RougailBaseTemplate:
@ -217,20 +206,12 @@ class RougailBaseTemplate:
self.config = config
self.destinations_dir = abspath(rougailconfig['destinations_dir'])
self.tmp_dir = abspath(rougailconfig['tmp_dir'])
self.templates_dir = []
templates_dir = rougailconfig['templates_dir']
if not isinstance(templates_dir, list):
templates_dir = [templates_dir]
for templ_dir in templates_dir:
self.templates_dir.append(abspath(templ_dir))
self.templates_dir = abspath(rougailconfig['templates_dir'])
self.patches_dir = abspath(rougailconfig['patches_dir'])
eos = {}
functions_file = rougailconfig['functions_file']
if not isinstance(functions_file, list):
functions_file = [functions_file]
for function in functions_file:
if isfile(function):
eosfunc = load_modules(function)
if isfile(functions_file):
eosfunc = load_modules(functions_file)
for func in dir(eosfunc):
if not func.startswith('_'):
eos[func] = getattr(eosfunc, func)
@ -242,7 +223,6 @@ class RougailBaseTemplate:
def patch_template(self,
filename: str,
templates_dir: str,
) -> None:
"""Apply patch to a template
"""
@ -258,25 +238,25 @@ class RougailBaseTemplate:
msg = _(f"Error applying patch: '{patch_file}'\n"
f"To reproduce and fix this error {patch_cmd_err}")
self.log.error(_(msg))
copy(join(templates_dir, filename), self.tmp_dir)
copy(join(self.templates_dir, filename), self.tmp_dir)
def prepare_template(self,
filename: str,
templates_dir: str,
) -> None:
"""Prepare template source file
"""
self.log.info(_("Copy template: '{filename}' -> '{self.tmp_dir}'"))
if not isdir(self.tmp_dir):
raise TemplateError(_(f'cannot find tmp_dir {self.tmp_dir}'))
copy(join(templates_dir, filename), self.tmp_dir)
self.patch_template(filename, templates_dir)
copy(filename, self.tmp_dir)
self.patch_template(filename)
def instance_file(self,
filevar: Dict,
type_: str,
service_name: str,
) -> str:
service_type: str,
) -> None:
"""Run templatisation on one file
"""
self.log.info(_("Instantiating file '{filename}'"))
@ -291,7 +271,6 @@ class RougailBaseTemplate:
variable = [variable]
if not isdir(self.destinations_dir):
raise TemplateError(_(f'cannot find destinations_dir {self.destinations_dir}'))
destfilenames = []
for idx, filename, in enumerate(filenames):
if variable:
var = variable[idx]
@ -301,42 +280,31 @@ class RougailBaseTemplate:
data = getattr(self, func)(filevar,
filename,
service_name,
service_type,
variable,
idx,
)
if data is None:
continue
filename, source, true_destfilename, var = data
destfilename = join(self.destinations_dir, true_destfilename[1:])
filename, source, destfile, var = data
destfilename = join(self.destinations_dir, destfile[1:])
makedirs(dirname(destfilename), exist_ok=True)
self.log.info(_(f"{filevar['engine']} processing: '{destfilename}'"))
self.engines[filevar['engine']].process(filename=filename,
source=source,
true_destfilename=true_destfilename,
true_destfilename=destfile,
destfilename=destfilename,
destdir=self.destinations_dir,
variable=var,
index=idx,
rougail_variables_dict=self.rougail_variables_dict,
eosfunc=self.eosfunc,
)
self.process(true_destfilename,
destfilename,
filevar.get('mode'),
filevar.get('owner'),
filevar.get('group'),
)
destfilenames.append(destfilename)
return destfilenames
async def instance_files(self) -> None:
"""Run templatisation on all files
"""
try:
ori_dir = getcwd()
except FileNotFoundError:
ori_dir = None
chdir(self.tmp_dir)
chdir(self.templates_dir)
for option in await self.config.option.list(type='all'):
namespace = await option.option.name()
is_variable_namespace = namespace == self.rougailconfig['variable_namespace']
@ -348,18 +316,15 @@ class RougailBaseTemplate:
is_variable_namespace,
is_service_namespace,
)
for templates_dir in self.templates_dir:
for template in listdir(templates_dir):
self.prepare_template(template,
templates_dir,
)
files_to_delete = []
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.description()
service_type = await service_obj.information.get('type', 'service')
if await service_obj.option('activate').value.get() is False:
if included is False and not await service_obj.information.get('undisable', False):
self.desactive_service(service_name)
if included is False:
self.desactive_service(service_name, service_type)
continue
if not included:
engine = await service_obj.information.get('engine', None)
@ -367,18 +332,19 @@ class RougailBaseTemplate:
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()
self.get_default(type_, fill, fill_obj)
await self.get_informations(type_, fill, fill_obj)
if 'included' in fill:
if (fill['included'] == 'no' and included is True) or \
@ -387,40 +353,17 @@ class RougailBaseTemplate:
elif included is True:
continue
if fill['activate']:
destfilenames = self.instance_file(fill,
self.instance_file(fill,
type_,
service_name,
service_type,
)
if included and fill.get('included', 'no') == 'content':
files_to_delete.extend(destfilenames)
else:
self.log.debug(_(f"Instantiation of file '{fill['name']}' disabled"))
self.post_instance_service(service_name)
for filename in files_to_delete:
unlink(filename)
parent = filename
while True:
parent = dirname(parent)
if listdir(parent):
break
rmdir(parent)
self.log.debug(_("Instantiation of file '{filename}' disabled"))
self.post_instance_service(service_name, service_type)
self.post_instance()
if ori_dir is not None:
chdir(ori_dir)
def get_default(self,
type_: str,
dico: dict,
obj: 'Option',
) -> None:
for key in DEFAULT.get(type_, []):
default_key = f'default_{type_}_{key}'
if default_key in RougailConfig:
default_value = RougailConfig[default_key]
else:
default_value = undefined
dico[key] = dico.get(key, default_value)
async def get_informations(self,
type_: str,
dico: dict,
@ -450,11 +393,6 @@ class RougailBaseTemplate:
): # pragma: no cover
pass
def process(self,
*args,
): # pragma: no cover
raise NotImplementedError(_('cannot processed'))
def post_instance(self): # pragma: no cover
pass
@ -501,7 +439,7 @@ class RougailBaseTemplate:
await suboption.option.name(),
await suboption.option.path(),
)
variables[leadership_name] = RougailExtra({leader_name: leader})
variables[leadership_name] = leader
else:
if is_service_namespace == 'root':
new_is_service_namespace = 'service_name'
@ -530,10 +468,6 @@ class RougailBaseTemplate:
value = await option.value.get()
variables[await option.option.name()] = value
if isinstance(is_service_namespace, str) and is_service_namespace + 's' in INFORMATIONS:
self.get_default(is_service_namespace + 's',
variables,
optiondescription,
)
await self.get_informations(is_service_namespace + 's',
variables,
optiondescription,

View File

@ -97,7 +97,6 @@ def process(filename: str,
destfilename: str,
destdir: str,
variable: Any,
index: int,
rougail_variables_dict: Dict,
eosfunc: Dict,
):
@ -111,8 +110,6 @@ def process(filename: str,
}
if variable is not None:
extra_context['rougail_variable'] = variable
if index is not None:
extra_context['rougail_index'] = index
cheetah_template = CheetahTemplate(filename,
source,
rougail_variables_dict,
@ -121,7 +118,7 @@ def process(filename: str,
)
data = str(cheetah_template)
except NotFound as err: # pragma: no cover
varname = err.args[0][13:].split(' ', 1)[0][:-1]
varname = err.args[0][13:-1]
if filename:
msg = f"Error: unknown variable used in template {filename} to {destfilename}: {varname}"
else:

View File

@ -49,6 +49,7 @@ def cl_compile(kls, *args, **kwargs):
'multiLineCommentStartToken' : u'µ' * 10,
'multiLineCommentEndToken' : u'µ' * 10}
return kls.old_compile(*args, **kwargs) # pylint: disable=E1101
oriCheetahTemplate.compile = cl_compile
class IsDefined:
@ -118,15 +119,12 @@ def process(filename: str,
destfilename: str,
destdir: str,
variable: Any,
index: int,
rougail_variables_dict: Dict,
eosfunc: Dict,
):
"""Process a cheetah template
"""
# full path of the destination file
ori_compile = oriCheetahTemplate.compile
oriCheetahTemplate.compile = cl_compile
try:
extra_context = {'normalize_family': normalize_family,
'rougail_filename': true_destfilename,
@ -134,8 +132,6 @@ def process(filename: str,
}
if variable is not None:
extra_context['rougail_variable'] = variable
if index is not None:
extra_context['rougail_index'] = index
cheetah_template = CheetahTemplate(filename,
source,
rougail_variables_dict,
@ -149,16 +145,13 @@ def process(filename: str,
msg = f"Error: unknown variable used in template {filename} to {destfilename}: {varname}"
else:
msg = f"Error: unknown variable used in file {destfilename}: {varname}"
oriCheetahTemplate.compile = ori_compile
raise TemplateError(_(msg)) from err
except Exception as err: # pragma: no cover
if filename:
msg = _(f"Error while instantiating template {filename} to {destfilename}: {err}")
else:
msg = _(f"Error while instantiating filename {destfilename}: {err}")
oriCheetahTemplate.compile = ori_compile
raise TemplateError(msg) from err
with open(destfilename, 'w') as file_h:
file_h.write(data)
oriCheetahTemplate.compile = ori_compile

View File

@ -39,7 +39,6 @@ def process(filename: str,
destfilename: str,
destdir: str,
variable: Any,
index: int,
rougail_variables_dict: Dict,
eosfunc: Dict,
):
@ -49,11 +48,11 @@ def process(filename: str,
dir_name, template_name = filename.rsplit('/', 1)
if source is not None: # pragma: no cover
raise TemplateError(_('source is not supported for jinja2'))
var = {}
rougail_variables_dict['rougail_variable'] = variable
if variable is not None:
var['rougail_variable'] = variable
if index is not None:
var['rougail_index'] = index
var = {'rougail_variable': variable}
else:
var = {}
try:
# extra_context = {'normalize_family': normalize_family,
# eosfunc

View File

@ -21,13 +21,13 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
"""
from typing import Dict, Any
from os import makedirs, symlink, chmod
from os import makedirs, symlink
from os.path import dirname, isfile, join
from ipaddress import ip_network
from .base import RougailBaseTemplate
from ..i18n import _
from ..error import FileNotFound, TemplateError
from ..error import FileNotFound
ROUGAIL_IP_TEMPLATE = """[Service]
@ -38,24 +38,14 @@ IPAddressDeny=any
"""
ROUGAIL_DEST = '/usr/local/lib'
ROUGAIL_GLOBAL_SYSTEMD_FILE = '/usr/lib/systemd/system'
ROUGAIL_DEST_FILE = '/tmpfiles.d/0rougail.conf'
LOCAL_DIR = ('/etc/', '/var/', '/srv/')
class RougailSystemdTemplate(RougailBaseTemplate):
def __init__(self, # pylint: disable=R0913
config: 'Config',
rougailconfig: 'RougailConfig'=None,
) -> None:
self.ip_per_service = None
super().__init__(config, rougailconfig)
self.rougail_tmpl_template = f"""%def display(%%file, %%filename)
"""
tmp_local_dir = (f"%%filename.startswith('{local_dir}')" for local_dir in LOCAL_DIR)
self.rougail_tmpl_template += '%if ' + ' or '.join(tmp_local_dir)
self.rougail_tmpl_template += f"""
C %%filename %%file.mode %%file.owner %%file.group - {self.rougailconfig['tmpfile_dest_dir']}%%filename
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 - {ROUGAIL_DEST}%%filename
z %%filename - - - - -
%end if
%end def
%for %%service in %%services
@ -75,16 +65,26 @@ C %%filename %%file.mode %%file.owner %%file.group - {self.rougailconfig['tmpfil
%end for
"""
class RougailSystemdTemplate(RougailBaseTemplate):
def __init__(self, # pylint: disable=R0913
config: 'Config',
rougailconfig: 'RougailConfig'=None,
) -> None:
self.ip_per_service = None
super().__init__(config, rougailconfig)
def get_data_files(self,
filevar: Dict,
destfile: str,
service_name: str,
service_type: str,
variable,
idx: int,
) -> tuple:
source = filevar['source']
if not isfile(source): # pragma: no cover
raise FileNotFound(_(f'Source file "{source}" does not exist in {", ".join(self.templates_dir)}'))
raise FileNotFound(_(f"File {source} does not exist."))
tmp_file = join(self.tmp_dir, source)
#self.instance_file(fill, 'files')
if variable:
@ -97,20 +97,22 @@ C %%filename %%file.mode %%file.owner %%file.group - {self.rougailconfig['tmpfil
filevar: Dict,
destfile,
service_name: str,
service_type: str,
*args,
) -> tuple:
source = filevar['source']
if not isfile(source): # pragma: no cover
raise FileNotFound(_(f'Override source file "{source}" does not exist in {", ".join(self.templates_dir)}'))
raise FileNotFound(_(f"File {source} does not exist."))
tmp_file = join(self.tmp_dir, source)
service_name = filevar['name']
destfile = f'/systemd/system/{service_name}.d/rougail.conf'
destfile = f'/systemd/system/{service_name}.{service_type}.d/rougail.conf'
return tmp_file, None, destfile, None
def get_data_ip(self,
filevar: Dict,
ip,
service_name: str,
service_type: str,
var: Any,
idx: int,
*args,
@ -130,40 +132,45 @@ C %%filename %%file.mode %%file.owner %%file.group - {self.rougailconfig['tmpfil
servicevar: Dict,
info,
service_name: str,
service_type: str,
*args,
):
tmp_file = join(self.tmp_dir, service_name)
filename = f'{service_name}.{service_type}'
tmp_file = join(self.tmp_dir, filename)
var = None
destfile = f'/systemd/system/{service_name}'
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}'
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}'
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}'
source_filename = f'{ROUGAIL_GLOBAL_SYSTEMD_FILE}/{service_name}.{service_type}'
else:
source_filename = f"{self.rougailconfig['tmpfile_dest_dir']}/systemd/system/{service_name}"
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}.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}'"))
@ -173,40 +180,22 @@ C %%filename %%file.mode %%file.owner %%file.group - {self.rougailconfig['tmpfil
destfilename=destfilename,
destdir=self.destinations_dir,
variable=self.ip_per_service,
index=None,
rougail_variables_dict=self.rougail_variables_dict,
eosfunc=self.eosfunc,
)
self.ip_per_service = None
def process(self,
filename: str,
destfilename: str,
mode: str,
owner: str,
group: str,
) -> None:
for local_dir in LOCAL_DIR:
if filename.startswith(local_dir):
return
if owner not in [None, self.rougailconfig['default_files_owner']]:
raise TemplateError(_(f'cannot change owner of file {destfilename}'))
if group not in [None, self.rougailconfig['default_files_group']]:
raise TemplateError(_(f'cannot change group of file {destfilename}'))
if mode not in [None, self.rougailconfig['default_files_mode']]:
chmod(destfilename, eval(f'0o{mode}'))
def post_instance(self):
destfilename = join(self.destinations_dir, ROUGAIL_DEST_FILE[1:])
destfile = '/tmpfiles.d/rougail.conf'
destfilename = join(self.destinations_dir, destfile[1:])
makedirs(dirname(destfilename), exist_ok=True)
self.log.info(_(f"creole processing: '{destfilename}'"))
self.engines['creole'].process(filename=None,
source=self.rougail_tmpl_template,
true_destfilename=ROUGAIL_DEST_FILE,
source=ROUGAIL_TMPL_TEMPLATE,
true_destfilename=destfile,
destfilename=destfilename,
destdir=self.destinations_dir,
variable=None,
index=None,
rougail_variables_dict=self.rougail_variables_dict,
eosfunc=self.eosfunc,
)

View File

@ -36,8 +36,6 @@ class ConvertDynOptionDescription(DynOptionDescription):
Suffix could also contain invalid character, so we should "normalize" it
"""
def convert_suffix_to_path(self, suffix):
if suffix is None:
return suffix
if not isinstance(suffix, str):
suffix = str(suffix)
return normalize_family(suffix)

View File

@ -28,10 +28,14 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
from json import dumps
from os.path import isfile
from .i18n import _
from .annotator import CONVERT_OPTION
from .objspace import RootRougailObject
from .error import DictConsistencyError
class Root(): # pylint: disable=R0903
"""Root classes
"""
path = '.'
class BaseElt: # pylint: disable=R0903
@ -47,32 +51,20 @@ class TiramisuReflector:
"""
def __init__(self,
objectspace,
funcs_paths,
internal_functions,
funcs_path,
):
self.index = 0
self.text = []
if funcs_paths:
self.text.extend(["from importlib.machinery import SourceFileLoader as _SourceFileLoader",
"from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec",
"class func:",
" pass",
])
for funcs_path in funcs_paths:
if not isfile(funcs_path):
continue
self.text.extend([f"_loader = _SourceFileLoader('func', '{funcs_path}')",
"_spec = _spec_from_loader(_loader.name, _loader)",
"_func = _module_from_spec(_spec)",
"_loader.exec_module(_func)",
"for function in dir(_func):",
" if function.startswith('_'):",
" continue",
" setattr(func, function, getattr(_func, function))",
])
if internal_functions:
for func in internal_functions:
self.text.append(f"setattr(func, '{func}', {func})")
if funcs_path and isfile(funcs_path):
self.text.extend(["from importlib.machinery import SourceFileLoader",
"from importlib.util import spec_from_loader, module_from_spec",
f"loader = SourceFileLoader('func', '{funcs_path}')",
"spec = spec_from_loader(loader.name, loader)",
"func = module_from_spec(spec)",
"loader.exec_module(func)",
"for key, value in dict(locals()).items():",
" if key != ['SourceFileLoader', 'func']:",
" setattr(func, key, value)"])
self.text.extend(["try:",
" from tiramisu3 import *",
"except:",
@ -86,11 +78,8 @@ class TiramisuReflector:
def make_tiramisu_objects(self) -> None:
"""make tiramisu objects
"""
providers = {}
baseelt = BaseElt()
self.set_name(baseelt)
dynamic_path = ''
dynamic = False
basefamily = Family(baseelt,
self.text,
self.objectspace,
@ -98,12 +87,7 @@ class TiramisuReflector:
for elt in self.reorder_family():
self.populate_family(basefamily,
elt,
providers,
dynamic,
dynamic_path,
)
basefamily.elt.information = providers
basefamily.populate_informations()
self.baseelt = baseelt
def reorder_family(self):
@ -123,9 +107,6 @@ class TiramisuReflector:
def populate_family(self,
parent_family,
elt,
providers,
dynamic,
dynamic_path,
):
"""Populate family
"""
@ -134,21 +115,11 @@ class TiramisuReflector:
self.text,
self.objectspace,
)
if not dynamic_path:
dynamic_path = elt.name
else:
dynamic_path = dynamic_path + '.' + elt.name
if dynamic or hasattr(elt, 'suffixes'):
dynamic_path += '{suffix}'
dynamic = True
parent_family.add(family)
for children in vars(elt).values():
if isinstance(children, self.objectspace.family):
self.populate_family(family,
children,
providers,
dynamic,
dynamic_path,
)
continue
if isinstance(children, dict):
@ -160,21 +131,13 @@ class TiramisuReflector:
continue
if isinstance(child, self.objectspace.variable):
self.set_name(child)
sub_dynamic_path = dynamic_path + '.' + child.name
if dynamic:
sub_dynamic_path += '{suffix}'
family.add(Variable(child,
self.text,
self.objectspace,
providers,
sub_dynamic_path,
))
else:
self.populate_family(family,
child,
providers,
dynamic,
dynamic_path,
)
def set_name(self,
@ -188,7 +151,7 @@ class TiramisuReflector:
def get_text(self):
"""Get text
"""
self.baseelt.reflector_object.get([]) # pylint: disable=E1101
self.baseelt.reflector_object.get() # pylint: disable=E1101
return '\n'.join(self.text)
@ -207,25 +170,13 @@ class Common:
self.elt.reflector_object = self
self.object_type = None
def get(self, calls):
def get(self):
"""Get tiramisu's object
"""
self_calls = calls.copy()
if self.elt.path in self_calls:
msg = f'"{self.elt.path}" will make an infinite loop'
raise DictConsistencyError(msg, 80, self.elt.xmlfiles)
self_calls.append(self.elt.path)
self.calls = self_calls
if self.option_name is None:
self.option_name = self.elt.reflector_name
self.populate_attrib()
self.populate_informations()
if hasattr(self.elt, 'provider'):
name = 'provider:' + self.elt.provider
if name in self.providers:
msg = f'provider {name} declare multiple time'
raise DictConsistencyError(msg, 79, self.elt.xmlfiles)
self.providers[name] = self.dynamic_path
return self.option_name
def populate_attrib(self):
@ -267,7 +218,7 @@ class Common:
) -> str:
"""Populate properties
"""
option_name = child.source.reflector_object.get(self.calls)
option_name = child.source.reflector_object.get()
kwargs = (f"'condition': ParamOption({option_name}, todict=True, notraisepropertyerror=True), "
f"'expected': {self.populate_param(child.expected)}")
if child.inverse:
@ -280,11 +231,7 @@ class Common:
"""
if not hasattr(self.elt, 'information'):
return
if isinstance(self.elt.information, dict):
informations = self.elt.information
else:
informations = vars(self.elt.information)
for key, value in informations.items():
for key, value in vars(self.elt.information).items():
if key == 'xmlfiles':
continue
if isinstance(value, str):
@ -296,7 +243,7 @@ class Common:
):
"""Populate variable parameters
"""
if param.type in ['number', 'boolean', 'nil', 'string', 'port', 'choice', 'space']:
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)
@ -315,18 +262,18 @@ class Common:
return 'ParamSuffix()'
if param.type == 'index':
return 'ParamIndex()'
raise Exception(_(f'unknown type {param.type}')) # pragma: no cover
raise Exception(f'unknown type {param.type}') # pragma: no cover
def build_option_param(self,
param,
@staticmethod
def build_option_param(param,
) -> str:
"""build variable parameters
"""
option_name = param.text.reflector_object.get(self.calls)
option_name = param.text.reflector_object.get()
params = [f'{option_name}']
if hasattr(param, 'suffix'):
param_type = 'ParamDynOption'
family = param.family.reflector_object.get(self.calls)
family = param.family.reflector_object.get()
params.extend([f"'{param.suffix}'", f'{family}'])
else:
param_type = 'ParamOption'
@ -342,11 +289,7 @@ class Variable(Common):
elt,
text,
objectspace,
providers,
dynamic_path,
):
self.providers = providers
self.dynamic_path = dynamic_path
super().__init__(elt, text, objectspace)
self.object_type = CONVERT_OPTION[elt.type]['opttype']
@ -354,11 +297,11 @@ class Variable(Common):
keys: dict,
):
if hasattr(self.elt, 'opt'):
keys['opt'] = self.elt.opt.reflector_object.get(self.calls)
keys['opt'] = self.elt.opt.reflector_object.get()
if hasattr(self.elt, 'choice'):
values = self.elt.choice
if values[0].type == 'variable':
value = values[0].name.reflector_object.get(self.calls)
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], [])
@ -447,6 +390,6 @@ class Family(Common):
keys: list,
) -> None:
if hasattr(self.elt, 'suffixes'):
dyn = self.elt.suffixes.reflector_object.get(self.calls)
dyn = self.elt.suffixes.reflector_object.get()
keys['suffixes'] = f"Calculation(func.calc_value, Params((ParamOption({dyn}, notraisepropertyerror=True))))"
keys['children'] = '[' + ', '.join([child.get(self.calls) for child in self.children]) + ']'
keys['children'] = '[' + ', '.join([child.get() for child in self.children]) + ']'

View File

@ -116,7 +116,7 @@ class RougailUpgrade:
if variables is None:
return root
paths = self._get_path_variables(variables,
namespace == 'configuration',
namespace == self.rougailconfig['variable_namespace'],
namespace,
)
constraints = root.find('constraints')
@ -235,7 +235,7 @@ class RougailUpgrade:
function.append(param)
else:
choice = SubElement(target, 'choice')
if first_choice is None and ('type' not in param.attrib or param.attrib['type'] != 'variable'):
if first_choice is None:
first_choice = choice
choice.text = param.text
if 'type' not in param.attrib and param.text is None:
@ -334,7 +334,7 @@ class RougailUpgrade:
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 == 'configuration':
if namespace == self.rougailconfig['variable_namespace']:
path = subsubsubelement.attrib['name']
npath = normalize_family(subsubsubelement.attrib['name'])
else:

View File

@ -61,20 +61,11 @@ class XMLReflector:
:param xmlfolders: list of full folder's name
"""
filenames = {}
for xmlfolder in xmlfolders:
for filename in listdir(xmlfolder):
if not filename.endswith('.xml'):
continue
if filename in filenames:
raise DictConsistencyError(_(f'duplicate xml file name {filename}'), 78, [xmlfolder])
filenames[filename] = join(xmlfolder, filename)
if not filenames:
raise DictConsistencyError(_('there is no XML file'), 77, [xmlfolder])
file_names = list(filenames.keys())
file_names.sort()
for filename in file_names:
xmlfile = filenames[filename]
filenames = [join(xmlfolder, filename) for filename in listdir(xmlfolder) if \
filename.endswith('.xml')]
filenames.sort()
for xmlfile in filenames:
try:
document = parse(xmlfile)
except XMLSyntaxError as err:

View File

@ -1,9 +1,9 @@
{
"services.tata_service.activate": {
"services.tata.activate": {
"owner": "default",
"value": true
},
"services.tata_service.manage": {
"services.tata.manage": {
"owner": "default",
"value": true
}

View File

@ -1,4 +1,4 @@
{
"services.tata_service.activate": true,
"services.tata_service.manage": true
"services.tata.activate": true,
"services.tata.manage": true
}

View File

@ -1,9 +1,9 @@
{
"services.tata_service.activate": {
"services.tata.activate": {
"owner": "default",
"value": true
},
"services.tata_service.manage": {
"services.tata.manage": {
"owner": "default",
"value": true
}

View File

@ -1,21 +1,18 @@
from importlib.machinery import SourceFileLoader as _SourceFileLoader
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
class func:
pass
_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py')
_spec = _spec_from_loader(_loader.name, _loader)
_func = _module_from_spec(_spec)
_loader.exec_module(_func)
for function in dir(_func):
if function.startswith('_'):
continue
setattr(func, function, getattr(_func, function))
from importlib.machinery import SourceFileLoader
from importlib.util import spec_from_loader, module_from_spec
loader = SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py')
spec = spec_from_loader(loader.name, loader)
func = module_from_spec(spec)
loader.exec_module(func)
for key, value in dict(locals()).items():
if key != ['SourceFileLoader', 'func']:
setattr(func, key, value)
try:
from tiramisu3 import *
except:
from tiramisu import *
option_3 = BoolOption(name="activate", doc="activate", default=True)
option_4 = BoolOption(name="manage", doc="manage", default=True)
option_2 = OptionDescription(name="tata_service", doc="tata.service", children=[option_3, option_4])
option_2 = OptionDescription(name="tata", doc="tata", children=[option_3, option_4])
option_1 = OptionDescription(name="services", doc="services", children=[option_2], properties=frozenset({"hidden"}))
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1])

View File

@ -1,15 +1,12 @@
from importlib.machinery import SourceFileLoader as _SourceFileLoader
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
class func:
pass
_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py')
_spec = _spec_from_loader(_loader.name, _loader)
_func = _module_from_spec(_spec)
_loader.exec_module(_func)
for function in dir(_func):
if function.startswith('_'):
continue
setattr(func, function, getattr(_func, function))
from importlib.machinery import SourceFileLoader
from importlib.util import spec_from_loader, module_from_spec
loader = SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py')
spec = spec_from_loader(loader.name, loader)
func = module_from_spec(spec)
loader.exec_module(func)
for key, value in dict(locals()).items():
if key != ['SourceFileLoader', 'func']:
setattr(func, key, value)
try:
from tiramisu3 import *
except:

View File

@ -1,15 +1,12 @@
from importlib.machinery import SourceFileLoader as _SourceFileLoader
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
class func:
pass
_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py')
_spec = _spec_from_loader(_loader.name, _loader)
_func = _module_from_spec(_spec)
_loader.exec_module(_func)
for function in dir(_func):
if function.startswith('_'):
continue
setattr(func, function, getattr(_func, function))
from importlib.machinery import SourceFileLoader
from importlib.util import spec_from_loader, module_from_spec
loader = SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py')
spec = spec_from_loader(loader.name, loader)
func = module_from_spec(spec)
loader.exec_module(func)
for key, value in dict(locals()).items():
if key != ['SourceFileLoader', 'func']:
setattr(func, key, value)
try:
from tiramisu3 import *
except:

View File

@ -1,15 +1,12 @@
from importlib.machinery import SourceFileLoader as _SourceFileLoader
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
class func:
pass
_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py')
_spec = _spec_from_loader(_loader.name, _loader)
_func = _module_from_spec(_spec)
_loader.exec_module(_func)
for function in dir(_func):
if function.startswith('_'):
continue
setattr(func, function, getattr(_func, function))
from importlib.machinery import SourceFileLoader
from importlib.util import spec_from_loader, module_from_spec
loader = SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py')
spec = spec_from_loader(loader.name, loader)
func = module_from_spec(spec)
loader.exec_module(func)
for key, value in dict(locals()).items():
if key != ['SourceFileLoader', 'func']:
setattr(func, key, value)
try:
from tiramisu3 import *
except:

View File

@ -1,15 +1,12 @@
from importlib.machinery import SourceFileLoader as _SourceFileLoader
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
class func:
pass
_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py')
_spec = _spec_from_loader(_loader.name, _loader)
_func = _module_from_spec(_spec)
_loader.exec_module(_func)
for function in dir(_func):
if function.startswith('_'):
continue
setattr(func, function, getattr(_func, function))
from importlib.machinery import SourceFileLoader
from importlib.util import spec_from_loader, module_from_spec
loader = SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py')
spec = spec_from_loader(loader.name, loader)
func = module_from_spec(spec)
loader.exec_module(func)
for key, value in dict(locals()).items():
if key != ['SourceFileLoader', 'func']:
setattr(func, key, value)
try:
from tiramisu3 import *
except:

View File

@ -1,15 +1,12 @@
from importlib.machinery import SourceFileLoader as _SourceFileLoader
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
class func:
pass
_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py')
_spec = _spec_from_loader(_loader.name, _loader)
_func = _module_from_spec(_spec)
_loader.exec_module(_func)
for function in dir(_func):
if function.startswith('_'):
continue
setattr(func, function, getattr(_func, function))
from importlib.machinery import SourceFileLoader
from importlib.util import spec_from_loader, module_from_spec
loader = SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py')
spec = spec_from_loader(loader.name, loader)
func = module_from_spec(spec)
loader.exec_module(func)
for key, value in dict(locals()).items():
if key != ['SourceFileLoader', 'func']:
setattr(func, key, value)
try:
from tiramisu3 import *
except:

View File

@ -1,15 +1,12 @@
from importlib.machinery import SourceFileLoader as _SourceFileLoader
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
class func:
pass
_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py')
_spec = _spec_from_loader(_loader.name, _loader)
_func = _module_from_spec(_spec)
_loader.exec_module(_func)
for function in dir(_func):
if function.startswith('_'):
continue
setattr(func, function, getattr(_func, function))
from importlib.machinery import SourceFileLoader
from importlib.util import spec_from_loader, module_from_spec
loader = SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py')
spec = spec_from_loader(loader.name, loader)
func = module_from_spec(spec)
loader.exec_module(func)
for key, value in dict(locals()).items():
if key != ['SourceFileLoader', 'func']:
setattr(func, key, value)
try:
from tiramisu3 import *
except:

View File

@ -1,15 +1,12 @@
from importlib.machinery import SourceFileLoader as _SourceFileLoader
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
class func:
pass
_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py')
_spec = _spec_from_loader(_loader.name, _loader)
_func = _module_from_spec(_spec)
_loader.exec_module(_func)
for function in dir(_func):
if function.startswith('_'):
continue
setattr(func, function, getattr(_func, function))
from importlib.machinery import SourceFileLoader
from importlib.util import spec_from_loader, module_from_spec
loader = SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py')
spec = spec_from_loader(loader.name, loader)
func = module_from_spec(spec)
loader.exec_module(func)
for key, value in dict(locals()).items():
if key != ['SourceFileLoader', 'func']:
setattr(func, key, value)
try:
from tiramisu3 import *
except:

View File

@ -1,10 +1,10 @@
{
"rougail.general.mode_conteneur_actif1": {
"owner": "default",
"value": "non"
},
"rougail.general.mode_conteneur_actif": {
"owner": "default",
"value": "non"
},
"rougail.general.mode_conteneur_actif1": {
"owner": "default",
"value": "non"
}
}

View File

@ -1,4 +1,4 @@
{
"rougail.general.mode_conteneur_actif1": "non",
"rougail.general.mode_conteneur_actif": "non"
"rougail.general.mode_conteneur_actif": "non",
"rougail.general.mode_conteneur_actif1": "non"
}

View File

@ -1,10 +1,10 @@
{
"rougail.general.mode_conteneur_actif1": {
"owner": "default",
"value": "non"
},
"rougail.general.mode_conteneur_actif": {
"owner": "default",
"value": "non"
},
"rougail.general.mode_conteneur_actif1": {
"owner": "default",
"value": "non"
}
}

View File

@ -1,21 +1,18 @@
from importlib.machinery import SourceFileLoader as _SourceFileLoader
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
class func:
pass
_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py')
_spec = _spec_from_loader(_loader.name, _loader)
_func = _module_from_spec(_spec)
_loader.exec_module(_func)
for function in dir(_func):
if function.startswith('_'):
continue
setattr(func, function, getattr(_func, function))
from importlib.machinery import SourceFileLoader
from importlib.util import spec_from_loader, module_from_spec
loader = SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py')
spec = spec_from_loader(loader.name, loader)
func = module_from_spec(spec)
loader.exec_module(func)
for key, value in dict(locals()).items():
if key != ['SourceFileLoader', 'func']:
setattr(func, key, value)
try:
from tiramisu3 import *
except:
from tiramisu import *
option_3 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"}))
option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"}))
option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"}))
option_4 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"}))
option_2 = OptionDescription(name="general", doc="général", children=[option_3, option_4], properties=frozenset({"normal"}))
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2])
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1])

View File

@ -1,15 +1,12 @@
from importlib.machinery import SourceFileLoader as _SourceFileLoader
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
class func:
pass
_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py')
_spec = _spec_from_loader(_loader.name, _loader)
_func = _module_from_spec(_spec)
_loader.exec_module(_func)
for function in dir(_func):
if function.startswith('_'):
continue
setattr(func, function, getattr(_func, function))
from importlib.machinery import SourceFileLoader
from importlib.util import spec_from_loader, module_from_spec
loader = SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py')
spec = spec_from_loader(loader.name, loader)
func = module_from_spec(spec)
loader.exec_module(func)
for key, value in dict(locals()).items():
if key != ['SourceFileLoader', 'func']:
setattr(func, key, value)
try:
from tiramisu3 import *
except:

View File

@ -1,15 +1,12 @@
from importlib.machinery import SourceFileLoader as _SourceFileLoader
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
class func:
pass
_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py')
_spec = _spec_from_loader(_loader.name, _loader)
_func = _module_from_spec(_spec)
_loader.exec_module(_func)
for function in dir(_func):
if function.startswith('_'):
continue
setattr(func, function, getattr(_func, function))
from importlib.machinery import SourceFileLoader
from importlib.util import spec_from_loader, module_from_spec
loader = SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py')
spec = spec_from_loader(loader.name, loader)
func = module_from_spec(spec)
loader.exec_module(func)
for key, value in dict(locals()).items():
if key != ['SourceFileLoader', 'func']:
setattr(func, key, value)
try:
from tiramisu3 import *
except:

View File

@ -1,15 +1,12 @@
from importlib.machinery import SourceFileLoader as _SourceFileLoader
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
class func:
pass
_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py')
_spec = _spec_from_loader(_loader.name, _loader)
_func = _module_from_spec(_spec)
_loader.exec_module(_func)
for function in dir(_func):
if function.startswith('_'):
continue
setattr(func, function, getattr(_func, function))
from importlib.machinery import SourceFileLoader
from importlib.util import spec_from_loader, module_from_spec
loader = SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py')
spec = spec_from_loader(loader.name, loader)
func = module_from_spec(spec)
loader.exec_module(func)
for key, value in dict(locals()).items():
if key != ['SourceFileLoader', 'func']:
setattr(func, key, value)
try:
from tiramisu3 import *
except:

View File

@ -1,15 +1,12 @@
from importlib.machinery import SourceFileLoader as _SourceFileLoader
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
class func:
pass
_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py')
_spec = _spec_from_loader(_loader.name, _loader)
_func = _module_from_spec(_spec)
_loader.exec_module(_func)
for function in dir(_func):
if function.startswith('_'):
continue
setattr(func, function, getattr(_func, function))
from importlib.machinery import SourceFileLoader
from importlib.util import spec_from_loader, module_from_spec
loader = SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py')
spec = spec_from_loader(loader.name, loader)
func = module_from_spec(spec)
loader.exec_module(func)
for key, value in dict(locals()).items():
if key != ['SourceFileLoader', 'func']:
setattr(func, key, value)
try:
from tiramisu3 import *
except:

View File

@ -3,27 +3,27 @@
"owner": "default",
"value": "non"
},
"services.test_service.files.file.name": {
"services.test.files.file.name": {
"owner": "default",
"value": "/etc/file"
},
"services.test_service.files.file.activate": {
"services.test.files.file.activate": {
"owner": "default",
"value": true
},
"services.test_service.files.file2.name": {
"services.test.files.file2.name": {
"owner": "default",
"value": "/etc/file2"
},
"services.test_service.files.file2.activate": {
"services.test.files.file2.activate": {
"owner": "default",
"value": true
},
"services.test_service.activate": {
"services.test.activate": {
"owner": "default",
"value": true
},
"services.test_service.manage": {
"services.test.manage": {
"owner": "default",
"value": true
}

View File

@ -1,9 +1,9 @@
{
"rougail.general.mode_conteneur_actif": "non",
"services.test_service.files.file.name": "/etc/file",
"services.test_service.files.file.activate": true,
"services.test_service.files.file2.name": "/etc/file2",
"services.test_service.files.file2.activate": true,
"services.test_service.activate": true,
"services.test_service.manage": true
"services.test.files.file.name": "/etc/file",
"services.test.files.file.activate": true,
"services.test.files.file2.name": "/etc/file2",
"services.test.files.file2.activate": true,
"services.test.activate": true,
"services.test.manage": true
}

View File

@ -3,27 +3,27 @@
"owner": "default",
"value": "non"
},
"services.test_service.files.file.name": {
"services.test.files.file.name": {
"owner": "default",
"value": "/etc/file"
},
"services.test_service.files.file.activate": {
"services.test.files.file.activate": {
"owner": "default",
"value": true
},
"services.test_service.files.file2.name": {
"services.test.files.file2.name": {
"owner": "default",
"value": "/etc/file2"
},
"services.test_service.files.file2.activate": {
"services.test.files.file2.activate": {
"owner": "default",
"value": true
},
"services.test_service.activate": {
"services.test.activate": {
"owner": "default",
"value": true
},
"services.test_service.manage": {
"services.test.manage": {
"owner": "default",
"value": true
}

View File

@ -1,2 +1,4 @@
C /etc/file 0644 root root - /usr/local/lib/etc/file
z /etc/file - - - - -
C /etc/file2 0644 root root - /usr/local/lib/etc/file2
z /etc/file2 - - - - -

View File

@ -1,15 +1,12 @@
from importlib.machinery import SourceFileLoader as _SourceFileLoader
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
class func:
pass
_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py')
_spec = _spec_from_loader(_loader.name, _loader)
_func = _module_from_spec(_spec)
_loader.exec_module(_func)
for function in dir(_func):
if function.startswith('_'):
continue
setattr(func, function, getattr(_func, function))
from importlib.machinery import SourceFileLoader
from importlib.util import spec_from_loader, module_from_spec
loader = SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py')
spec = spec_from_loader(loader.name, loader)
func = module_from_spec(spec)
loader.exec_module(func)
for key, value in dict(locals()).items():
if key != ['SourceFileLoader', 'func']:
setattr(func, key, value)
try:
from tiramisu3 import *
except:
@ -29,6 +26,6 @@ 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_service", doc="test.service", children=[option_6, option_13, option_14])
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,17 +0,0 @@
<?xml version='1.0' encoding='UTF-8'?>
<rougail version="0.10">
<services>
<service name="test">
<file>/etc/file</file>
<file engine="jinja2">/etc/file2</file>
<file disabled='True'>/etc/file3</file>
</service>
</services>
<variables>
<family name="general">
<variable name="mode_conteneur_actif" type="string" description="Description">
<value>non</value>
</variable>
</family>
</variables>
</rougail>

View File

@ -1,38 +0,0 @@
{
"rougail.general.mode_conteneur_actif": {
"owner": "default",
"value": "non"
},
"services.test_service.files.file.name": {
"owner": "default",
"value": "/etc/file"
},
"services.test_service.files.file.activate": {
"owner": "default",
"value": true
},
"services.test_service.files.file2.name": {
"owner": "default",
"value": "/etc/file2"
},
"services.test_service.files.file2.activate": {
"owner": "default",
"value": true
},
"services.test_service.files.file3.name": {
"owner": "default",
"value": "/etc/file3"
},
"services.test_service.files.file3.activate": {
"owner": "default",
"value": false
},
"services.test_service.activate": {
"owner": "default",
"value": true
},
"services.test_service.manage": {
"owner": "default",
"value": true
}
}

View File

@ -1,11 +0,0 @@
{
"rougail.general.mode_conteneur_actif": "non",
"services.test_service.files.file.name": "/etc/file",
"services.test_service.files.file.activate": true,
"services.test_service.files.file2.name": "/etc/file2",
"services.test_service.files.file2.activate": true,
"services.test_service.files.file3.name": "/etc/file3",
"services.test_service.files.file3.activate": false,
"services.test_service.activate": true,
"services.test_service.manage": true
}

View File

@ -1,38 +0,0 @@
{
"rougail.general.mode_conteneur_actif": {
"owner": "default",
"value": "non"
},
"services.test_service.files.file.name": {
"owner": "default",
"value": "/etc/file"
},
"services.test_service.files.file.activate": {
"owner": "default",
"value": true
},
"services.test_service.files.file2.name": {
"owner": "default",
"value": "/etc/file2"
},
"services.test_service.files.file2.activate": {
"owner": "default",
"value": true
},
"services.test_service.files.file3.name": {
"owner": "default",
"value": "/etc/file3"
},
"services.test_service.files.file3.activate": {
"owner": "default",
"value": false
},
"services.test_service.activate": {
"owner": "default",
"value": true
},
"services.test_service.manage": {
"owner": "default",
"value": true
}
}

View File

@ -1,2 +0,0 @@
non
non

View File

@ -1,2 +0,0 @@
non
non

View File

@ -1,38 +0,0 @@
from importlib.machinery import SourceFileLoader as _SourceFileLoader
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
class func:
pass
_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py')
_spec = _spec_from_loader(_loader.name, _loader)
_func = _module_from_spec(_spec)
_loader.exec_module(_func)
for function in dir(_func):
if function.startswith('_'):
continue
setattr(func, function, getattr(_func, function))
try:
from tiramisu3 import *
except:
from tiramisu import *
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 = 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/file3")
option_15 = BoolOption(name="activate", doc="activate", default=False)
option_13 = OptionDescription(name="file3", doc="file3", children=[option_14, option_15])
option_13.impl_set_information('source', "file3")
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_service", doc="test.service", 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,2 +0,0 @@
%%mode_conteneur_actif
%%rougail.general.mode_conteneur_actif

View File

@ -1,2 +0,0 @@
{{ mode_conteneur_actif }}
{{ rougail.general.mode_conteneur_actif }}

View File

@ -3,27 +3,27 @@
"owner": "default",
"value": "non"
},
"services.test_service.files.file.name": {
"services.test.files.file.name": {
"owner": "default",
"value": "/etc/file"
},
"services.test_service.files.file.activate": {
"services.test.files.file.activate": {
"owner": "default",
"value": true
},
"services.test_service.files.file2.name": {
"services.test.files.file2.name": {
"owner": "default",
"value": "/etc/file2"
},
"services.test_service.files.file2.activate": {
"services.test.files.file2.activate": {
"owner": "default",
"value": true
},
"services.test_service.activate": {
"services.test.activate": {
"owner": "default",
"value": true
},
"services.test_service.manage": {
"services.test.manage": {
"owner": "default",
"value": true
}

View File

@ -1,9 +1,9 @@
{
"rougail.general.mode_conteneur_actif": "non",
"services.test_service.files.file.name": "/etc/file",
"services.test_service.files.file.activate": true,
"services.test_service.files.file2.name": "/etc/file2",
"services.test_service.files.file2.activate": true,
"services.test_service.activate": true,
"services.test_service.manage": true
"services.test.files.file.name": "/etc/file",
"services.test.files.file.activate": true,
"services.test.files.file2.name": "/etc/file2",
"services.test.files.file2.activate": true,
"services.test.activate": true,
"services.test.manage": true
}

View File

@ -3,27 +3,27 @@
"owner": "default",
"value": "non"
},
"services.test_service.files.file.name": {
"services.test.files.file.name": {
"owner": "default",
"value": "/etc/file"
},
"services.test_service.files.file.activate": {
"services.test.files.file.activate": {
"owner": "default",
"value": true
},
"services.test_service.files.file2.name": {
"services.test.files.file2.name": {
"owner": "default",
"value": "/etc/file2"
},
"services.test_service.files.file2.activate": {
"services.test.files.file2.activate": {
"owner": "default",
"value": true
},
"services.test_service.activate": {
"services.test.activate": {
"owner": "default",
"value": true
},
"services.test_service.manage": {
"services.test.manage": {
"owner": "default",
"value": true
}

View File

@ -1,2 +1,4 @@
C /etc/file 0644 root root - /usr/local/lib/etc/file
z /etc/file - - - - -
C /etc/file2 0644 root root - /usr/local/lib/etc/file2
z /etc/file2 - - - - -

View File

@ -1,15 +1,12 @@
from importlib.machinery import SourceFileLoader as _SourceFileLoader
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
class func:
pass
_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py')
_spec = _spec_from_loader(_loader.name, _loader)
_func = _module_from_spec(_spec)
_loader.exec_module(_func)
for function in dir(_func):
if function.startswith('_'):
continue
setattr(func, function, getattr(_func, function))
from importlib.machinery import SourceFileLoader
from importlib.util import spec_from_loader, module_from_spec
loader = SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py')
spec = spec_from_loader(loader.name, loader)
func = module_from_spec(spec)
loader.exec_module(func)
for key, value in dict(locals()).items():
if key != ['SourceFileLoader', 'func']:
setattr(func, key, value)
try:
from tiramisu3 import *
except:
@ -29,6 +26,6 @@ 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_service", doc="test.service", children=[option_6, option_13, option_14])
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

@ -3,35 +3,35 @@
"owner": "default",
"value": "non"
},
"services.test_service.files.file.name": {
"services.test.files.file.name": {
"owner": "default",
"value": "/etc/file"
},
"services.test_service.files.file.activate": {
"services.test.files.file.activate": {
"owner": "default",
"value": true
},
"services.test_service.files.file2.name": {
"services.test.files.file2.name": {
"owner": "default",
"value": "/etc/file2"
},
"services.test_service.files.file2.activate": {
"services.test.files.file2.activate": {
"owner": "default",
"value": true
},
"services.test_service.files.incfile.name": {
"services.test.files.incfile.name": {
"owner": "default",
"value": "/etc/dir/incfile"
},
"services.test_service.files.incfile.activate": {
"services.test.files.incfile.activate": {
"owner": "default",
"value": true
},
"services.test_service.activate": {
"services.test.activate": {
"owner": "default",
"value": true
},
"services.test_service.manage": {
"services.test.manage": {
"owner": "default",
"value": true
}

View File

@ -1,11 +1,11 @@
{
"rougail.general.mode_conteneur_actif": "non",
"services.test_service.files.file.name": "/etc/file",
"services.test_service.files.file.activate": true,
"services.test_service.files.file2.name": "/etc/file2",
"services.test_service.files.file2.activate": true,
"services.test_service.files.incfile.name": "/etc/dir/incfile",
"services.test_service.files.incfile.activate": true,
"services.test_service.activate": true,
"services.test_service.manage": true
"services.test.files.file.name": "/etc/file",
"services.test.files.file.activate": true,
"services.test.files.file2.name": "/etc/file2",
"services.test.files.file2.activate": true,
"services.test.files.incfile.name": "/etc/dir/incfile",
"services.test.files.incfile.activate": true,
"services.test.activate": true,
"services.test.manage": true
}

View File

@ -3,35 +3,35 @@
"owner": "default",
"value": "non"
},
"services.test_service.files.file.name": {
"services.test.files.file.name": {
"owner": "default",
"value": "/etc/file"
},
"services.test_service.files.file.activate": {
"services.test.files.file.activate": {
"owner": "default",
"value": true
},
"services.test_service.files.file2.name": {
"services.test.files.file2.name": {
"owner": "default",
"value": "/etc/file2"
},
"services.test_service.files.file2.activate": {
"services.test.files.file2.activate": {
"owner": "default",
"value": true
},
"services.test_service.files.incfile.name": {
"services.test.files.incfile.name": {
"owner": "default",
"value": "/etc/dir/incfile"
},
"services.test_service.files.incfile.activate": {
"services.test.files.incfile.activate": {
"owner": "default",
"value": true
},
"services.test_service.activate": {
"services.test.activate": {
"owner": "default",
"value": true
},
"services.test_service.manage": {
"services.test.manage": {
"owner": "default",
"value": true
}

View File

@ -1,2 +1,4 @@
C /etc/file 0644 root root - /usr/local/lib/etc/file
z /etc/file - - - - -
C /etc/file2 0644 root root - /usr/local/lib/etc/file2
z /etc/file2 - - - - -

View File

@ -1,15 +1,12 @@
from importlib.machinery import SourceFileLoader as _SourceFileLoader
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
class func:
pass
_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py')
_spec = _spec_from_loader(_loader.name, _loader)
_func = _module_from_spec(_spec)
_loader.exec_module(_func)
for function in dir(_func):
if function.startswith('_'):
continue
setattr(func, function, getattr(_func, function))
from importlib.machinery import SourceFileLoader
from importlib.util import spec_from_loader, module_from_spec
loader = SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py')
spec = spec_from_loader(loader.name, loader)
func = module_from_spec(spec)
loader.exec_module(func)
for key, value in dict(locals()).items():
if key != ['SourceFileLoader', 'func']:
setattr(func, key, value)
try:
from tiramisu3 import *
except:
@ -34,6 +31,6 @@ 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_service", doc="test.service", children=[option_6, option_16, option_17])
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

@ -3,35 +3,35 @@
"owner": "default",
"value": "non"
},
"services.test_service.files.file.name": {
"services.test.files.file.name": {
"owner": "default",
"value": "/etc/file"
},
"services.test_service.files.file.activate": {
"services.test.files.file.activate": {
"owner": "default",
"value": true
},
"services.test_service.files.file2.name": {
"services.test.files.file2.name": {
"owner": "default",
"value": "/etc/file2"
},
"services.test_service.files.file2.activate": {
"services.test.files.file2.activate": {
"owner": "default",
"value": true
},
"services.test_service.files.incfile.name": {
"services.test.files.incfile.name": {
"owner": "default",
"value": "/etc/dir/incfile"
},
"services.test_service.files.incfile.activate": {
"services.test.files.incfile.activate": {
"owner": "default",
"value": true
},
"services.test_service.activate": {
"services.test.activate": {
"owner": "default",
"value": true
},
"services.test_service.manage": {
"services.test.manage": {
"owner": "default",
"value": true
}

View File

@ -1,11 +1,11 @@
{
"rougail.general.mode_conteneur_actif": "non",
"services.test_service.files.file.name": "/etc/file",
"services.test_service.files.file.activate": true,
"services.test_service.files.file2.name": "/etc/file2",
"services.test_service.files.file2.activate": true,
"services.test_service.files.incfile.name": "/etc/dir/incfile",
"services.test_service.files.incfile.activate": true,
"services.test_service.activate": true,
"services.test_service.manage": true
"services.test.files.file.name": "/etc/file",
"services.test.files.file.activate": true,
"services.test.files.file2.name": "/etc/file2",
"services.test.files.file2.activate": true,
"services.test.files.incfile.name": "/etc/dir/incfile",
"services.test.files.incfile.activate": true,
"services.test.activate": true,
"services.test.manage": true
}

View File

@ -3,35 +3,35 @@
"owner": "default",
"value": "non"
},
"services.test_service.files.file.name": {
"services.test.files.file.name": {
"owner": "default",
"value": "/etc/file"
},
"services.test_service.files.file.activate": {
"services.test.files.file.activate": {
"owner": "default",
"value": true
},
"services.test_service.files.file2.name": {
"services.test.files.file2.name": {
"owner": "default",
"value": "/etc/file2"
},
"services.test_service.files.file2.activate": {
"services.test.files.file2.activate": {
"owner": "default",
"value": true
},
"services.test_service.files.incfile.name": {
"services.test.files.incfile.name": {
"owner": "default",
"value": "/etc/dir/incfile"
},
"services.test_service.files.incfile.activate": {
"services.test.files.incfile.activate": {
"owner": "default",
"value": true
},
"services.test_service.activate": {
"services.test.activate": {
"owner": "default",
"value": true
},
"services.test_service.manage": {
"services.test.manage": {
"owner": "default",
"value": true
}

View File

@ -1,3 +1,6 @@
C /etc/file 0644 root root - /usr/local/lib/etc/file
z /etc/file - - - - -
C /etc/file2 0644 root root - /usr/local/lib/etc/file2
z /etc/file2 - - - - -
C /etc/dir/incfile 0644 root root - /usr/local/lib/etc/dir/incfile
z /etc/dir/incfile - - - - -

View File

@ -1,15 +1,12 @@
from importlib.machinery import SourceFileLoader as _SourceFileLoader
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
class func:
pass
_loader = _SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py')
_spec = _spec_from_loader(_loader.name, _loader)
_func = _module_from_spec(_spec)
_loader.exec_module(_func)
for function in dir(_func):
if function.startswith('_'):
continue
setattr(func, function, getattr(_func, function))
from importlib.machinery import SourceFileLoader
from importlib.util import spec_from_loader, module_from_spec
loader = SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py')
spec = spec_from_loader(loader.name, loader)
func = module_from_spec(spec)
loader.exec_module(func)
for key, value in dict(locals()).items():
if key != ['SourceFileLoader', 'func']:
setattr(func, key, value)
try:
from tiramisu3 import *
except:
@ -34,6 +31,6 @@ 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_service", doc="test.service", children=[option_6, option_16, option_17])
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,16 +0,0 @@
<?xml version='1.0' encoding='UTF-8'?>
<rougail version="0.10">
<services>
<service name="test">
<file owner="nobody" group="nobody">/etc/file</file>
<file owner="nobody" group="nobody" engine="jinja2">/etc/file2</file>
</service>
</services>
<variables>
<family name="general">
<variable name="mode_conteneur_actif" type="string" description="Description">
<value>non</value>
</variable>
</family>
</variables>
</rougail>

View File

@ -1,46 +0,0 @@
{
"rougail.general.mode_conteneur_actif": {
"owner": "default",
"value": "non"
},
"services.test_service.files.file.group": {
"owner": "default",
"value": "nobody"
},
"services.test_service.files.file.name": {
"owner": "default",
"value": "/etc/file"
},
"services.test_service.files.file.owner": {
"owner": "default",
"value": "nobody"
},
"services.test_service.files.file.activate": {
"owner": "default",
"value": true
},
"services.test_service.files.file2.group": {
"owner": "default",
"value": "nobody"
},
"services.test_service.files.file2.name": {
"owner": "default",
"value": "/etc/file2"
},
"services.test_service.files.file2.owner": {
"owner": "default",
"value": "nobody"
},
"services.test_service.files.file2.activate": {
"owner": "default",
"value": true
},
"services.test_service.activate": {
"owner": "default",
"value": true
},
"services.test_service.manage": {
"owner": "default",
"value": true
}
}

View File

@ -1,13 +0,0 @@
{
"rougail.general.mode_conteneur_actif": "non",
"services.test_service.files.file.group": "nobody",
"services.test_service.files.file.name": "/etc/file",
"services.test_service.files.file.owner": "nobody",
"services.test_service.files.file.activate": true,
"services.test_service.files.file2.group": "nobody",
"services.test_service.files.file2.name": "/etc/file2",
"services.test_service.files.file2.owner": "nobody",
"services.test_service.files.file2.activate": true,
"services.test_service.activate": true,
"services.test_service.manage": true
}

View File

@ -1,46 +0,0 @@
{
"rougail.general.mode_conteneur_actif": {
"owner": "default",
"value": "non"
},
"services.test_service.files.file.group": {
"owner": "default",
"value": "nobody"
},
"services.test_service.files.file.name": {
"owner": "default",
"value": "/etc/file"
},
"services.test_service.files.file.owner": {
"owner": "default",
"value": "nobody"
},
"services.test_service.files.file.activate": {
"owner": "default",
"value": true
},
"services.test_service.files.file2.group": {
"owner": "default",
"value": "nobody"
},
"services.test_service.files.file2.name": {
"owner": "default",
"value": "/etc/file2"
},
"services.test_service.files.file2.owner": {
"owner": "default",
"value": "nobody"
},
"services.test_service.files.file2.activate": {
"owner": "default",
"value": true
},
"services.test_service.activate": {
"owner": "default",
"value": true
},
"services.test_service.manage": {
"owner": "default",
"value": true
}
}

View File

@ -1,2 +0,0 @@
non
non

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