Commit graph

38 commits

Author SHA1 Message Date
Darko Poljak
4c2d273f07 Unify string formatting
Use one way of string formatting: replace old `%` style with new `str.format`.

Resolve #855.
2021-03-31 08:19:34 +02:00
Darko Poljak
7a0b697f4c Implement maintaining object relationship graph
For each object maintain parent-child relationship graph, i.e. list of
parent objects ('parents' property) and list of children objects ('children'
property).

Objects without parent(s) are objects specified in init manifest.
Objects without children are object of types that do not reuse other types.
2021-03-30 12:09:59 +02:00
Dennis Camera
ce07021580 Do not subclass object 2020-06-21 16:53:47 +02:00
Darko Poljak
da274e5ef3 Redefine/reimplement CDIST_ORDER_DEPENDENCY
CDIST_ORDER_DEPENDENCY now defines type order dependency context.
cdist (emulator) maintains global state variables, as files,
order_dep_state and typeorder_dep, and per object state variable,
as file, typeorder_dep.

If order_dep_state exists then this defines that order dependency is
turned on.
If order_dep_state does not exist then order dependency is turned off.

If order dependency is on then objects created after it is turned on are
recorded into:
    * global typeorder_dep, in case of init manifest
    * object's typeorder_dep, in case of type's manifest.

If order dependency is on then requirement is injected, where object
created before current, is read from:
    * global typeorder_dep, in case of init manifest
    * object's typeorder_dep, in case of type's manifest.

Every time order dependency is turned off, typeorder_dep files are
removed, which means that type order list is cleared, context is
cleaned.

In the end cdist cleans after itself, i.e. mentioned files are removed.

When running type manifest is finished typeorder_dep file is removed.
When running config finishes global typeorder_dep and order_dep_state
files are removed.

Global type order recording is untouched.
Furthermore, for completeness, type order is now recorded for each object
too.
2019-11-27 15:04:47 +01:00
Darko Poljak
51fa8af6b7 pycodestyle 2019-02-15 20:35:32 +01:00
Darko Poljak
9703e0f08e Save output streams.
Implementation is 99% based on Steven's initial implementation.
2018-01-09 09:31:40 +01:00
Darko Poljak
ca1cc0f64a object_id = '/' is invalid 2017-08-10 19:08:44 +02:00
Darko Poljak
b50e605441 Merge pull request #544 from darko-poljak/ignore-dot-files-under-conf-types
Ignore directory entries that begin with dot('.').
2017-07-14 14:49:20 +02:00
Darko Poljak
80c3dd7572 Ignore directory entries that begin with dot('.'). 2017-07-06 13:30:57 +02:00
Darko Poljak
a722f3c634 3rd iteration of logging cleanup. 2017-07-04 23:49:43 +02:00
Darko Poljak
64efa04599 pep8 2016-07-05 20:44:24 +02:00
Nico Schottelius
d08c29b581 fix most test cases broken by no-dot-cdist change
Signed-off-by: Nico Schottelius <nico@freiheit.schottelius.org>
2015-03-05 18:32:47 +01:00
Nico Schottelius
73c77dd2d3 Let core use random .cdist directory for objects
Signed-off-by: Nico Schottelius <nico@freiheit.schottelius.org>
2015-03-05 15:02:26 +01:00
Nico Schottelius
c363fc24de begin to make OBJECT_MARKER dynamic
Signed-off-by: Nico Schottelius <nico@bento.schottelius.org>
2014-05-06 00:28:18 +02:00
Daniel Heule
2dd2f5593f bugfixes for issue 161 and FIXME: also check that there is no object ID
when type is singleton?
2014-02-09 17:10:43 +01:00
Daniel Heule
197fabf40a added some ideas from asteven and a bit more description about the order
in the manpage
2014-01-31 17:56:55 +01:00
Daniel Heule
4ef55ef13f allow object overrides with CDIST_ALLOW_OVERRIDE=true 2014-01-27 16:19:01 +01:00
Nico Schottelius
a5fc3f5002 remove changed attribute of an object - was never used and will never be used
Signed-off-by: Nico Schottelius <nico@bento.schottelius.org>
2013-12-04 21:29:56 +01:00
Steven Armstrong
7205cd5ecf remove that crappy old singleton object_id thingy
Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
2013-07-10 16:31:58 +02:00
Nico Schottelius
25bdcb1602 cleanup tests and ... - 100% green
Signed-off-by: Nico Schottelius <nico@bento.schottelius.org>
2013-06-21 22:39:20 +02:00
Nico Schottelius
72fef03184 Merge branch 'execution_order' into execution_order_plus_general_changes 2013-05-15 09:16:59 +02:00
Nico Schottelius
0b4914a7f3 +comment wording
Signed-off-by: Nico Schottelius <nico@bento.schottelius.org>
2013-05-15 09:16:52 +02:00
Nico Schottelius
a265d87037 begin dry run in command line
Signed-off-by: Nico Schottelius <nico@bento.schottelius.org>
2013-05-02 16:41:16 +02:00
Nico Schottelius
85d24ce259 fix execution order - seems to be fine now
Signed-off-by: Nico Schottelius <nico@bento.schottelius.org>
2013-04-30 15:07:27 +02:00
Nico Schottelius
8a7c64f86a cleanups + indent errors
Signed-off-by: Nico Schottelius <nico@bento.schottelius.org>
2013-04-30 11:04:01 +02:00
Nico Schottelius
a064cc19b3 try new object orientated (hrrr) code instead of stage based
Signed-off-by: Nico Schottelius <nico@bento.schottelius.org>
2013-04-30 10:58:23 +02:00
Nico Schottelius
cb829ec8d0 introduce MissingObjectIdError
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
2013-02-05 22:50:22 +01:00
Nico Schottelius
2732a4ba5c finally finish the dynamic resolver
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
2012-12-19 21:10:18 +01:00
Nico Schottelius
369305f376 remove circularreferenceerror, because it is not being used anymore
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
2012-12-19 15:33:41 +01:00
Nico Schottelius
8031c77700 fix some tests, break some others :-)
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
2012-12-18 18:21:51 +01:00
Nico Schottelius
958d2d336f various cleanups
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
2012-12-18 17:16:26 +01:00
Nico Schottelius
cd8b3cf68d finish rewrite of dependency resolver
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
2012-12-16 12:47:13 +01:00
Nico Schottelius
6a8778e595 remove most of the resolver boilerplate, keep the interesting functions
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
2012-12-14 08:43:52 +01:00
Nico Schottelius
81c92e5cc4 merge all resolver code into cdist_object (to gain the requirement searching code
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
2012-12-14 08:41:56 +01:00
Nico Schottelius
16340b7d34 report on broken requirements, begin to satisfy requirements
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
2012-12-14 08:41:17 +01:00
Nico Schottelius
2fe647a1f7 Revert "implement before/after to declare dependencies and deprecate require"
Comment from asteven:
    Some problems showed up while updating the docs and tests.
    You should revert the merge for now.

This reverts commit 84770b9ef2.
2012-11-19 15:17:46 +01:00
Steven Armstrong
84770b9ef2 implement before/after to declare dependencies and deprecate require
Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>

--whitespace

Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
2012-11-19 12:29:49 +01:00
Nico Schottelius
c9f728e073 lib/cdist => cdist (pypi)
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
2012-10-25 17:21:58 +02:00
Renamed from lib/cdist/core/cdist_object.py (Browse further)