Commit graph

118 commits

Author SHA1 Message Date
Darko Poljak
199effb7ef Improve unfinished object requirements bool check
When we need only boolean value for unfinished object requirements then
we don't need to determine the whole list of unfinished objects.
2021-04-06 19:35:14 +02:00
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
f984a918b9 Fix log message string formatting
Use logging message format with args, instead of direct `%` or `str.format`.

Resolve #855.
2021-03-31 08:19:28 +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
d478bef8a6 Merge branch 'lint/py3-classes' into 'master'
Consequently use Python 3-style classes

See merge request ungleich-public/cdist!898
2020-06-21 17:54:56 +02:00
Dennis Camera
ce07021580 Do not subclass object 2020-06-21 16:53:47 +02:00
Darko Poljak
59b98091d7 Adapt; update docs and code style 2020-06-13 13:44:01 +02:00
Steven Armstrong
6e9e9ad557 implement log server to capture nested logging output
Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
2020-06-13 13:44:01 +02:00
Darko Poljak
840e417eb7 Fix emulator colored logging 2020-06-11 14:16:37 +02:00
Dennis Camera
747c6b1076 Respect NO_COLOR environment variable 2020-06-03 22:17:52 +02:00
ba77ea9edc [UX] Add option to enable LogLevel-based coloured output.
This makes it easier for new and experienced users to run cdist with higher
verbosity levels, both to know that things are working as expected and to debug
issues.

Documentation has been modified accordingly and default behaviour is not
changed.
2020-06-01 19:11:58 +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
3cb4e76175 Allow custom message for each deprecated parameter 2019-06-20 10:54:40 +02:00
Darko Poljak
55ba49efac Add support for deprecated type parameters 2019-06-19 18:19:32 +02:00
Darko Poljak
4949af894e Add type deprecation support. 2019-05-20 18:50:25 +02:00
69622b0fa5 set __cdist_dry_run env var if dry-run 2019-05-16 21:58:47 +02:00
Darko Poljak
7c0ba0d5be pycodestyle 2019-04-22 21:11:36 +02:00
Darko Poljak
087066687c Report explorer error better
Fixes #766
2019-04-20 14:30:28 +02:00
Darko Poljak
51fa8af6b7 pycodestyle 2019-02-15 20:35:32 +01:00
Darko Poljak
8c03518962 Fix spelling. 2018-10-17 07:09:59 +02:00
Darko Poljak
0c57b3083e Fix getting loggers. 2018-09-23 21:38:03 +02:00
dhivael
f918acd725 don't duplicate Remote::mkdir in explorer transfer
Remote::transfer contains a call to mkdir(destination) if the source is
a directory. since the destination must also be a directory we can omit
extra mkdir calls in Explorer.

this saves about 10% on my manifests in sequential mode, and about 6% in
parallel mode.
2018-09-22 13:16:22 +02:00
Darko Poljak
6946dc877a pep8 2018-05-17 13:33:58 +02:00
Darko Poljak
3cf417fa2b Fix NameError: name 'cdist_object' is not defined, #662 2018-05-15 12:12:01 +02:00
Darko Poljak
cf36aece7d [BETA] bug: error info lost with parallel (option -j) #632 2018-02-25 23:48:53 +01:00
Darko Poljak
a993e0f5a9
Support disabling saving output streams 2018-02-07 18:12:15 +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
0bf6af6d22
Skip empty parameter. Fixes #599. (#600) 2017-11-15 07:30:35 +01:00
Darko Poljak
a8c41bfe44 Change warning message for invalid type. 2017-11-02 19:56:27 +01:00
Darko Poljak
782e662a13 Remove invalid type link from runtime conf dir at proper time. 2017-11-02 17:54:14 +01:00
Darko Poljak
c14f3b68f4 Warn about invalid type and continue instead of error. 2017-11-02 17:44:47 +01:00
Darko Poljak
e6c5563a16 NoSuchTypeError -> InvalidTypeError 2017-11-02 13:57:36 +01:00
Darko Poljak
764ea49904 Log more data. 2017-09-17 20:30:07 +02:00
Darko Poljak
f0dc21ec0c __cdist_log_level=<log level int value>; __cdist_log_level_name=<log level name> (#574) 2017-09-11 09:06:47 +02:00
Darko Poljak
3454da076f Add -l/--log-level option. Honor __cdist_loglevel env var. (#572)
Add -l/--log-level option, __cdist_loglevel -> __cdist_log_level; honor __cdist_log_level env var
2017-09-09 21:17:29 +02:00
Darko Poljak
f08ac264a0 pep8 2017-09-07 16:37:49 +02:00
Darko Poljak
57f15f9cce Make __cdist_loglevel value more expressive. (#571) 2017-09-07 16:36:23 +02:00
Darko Poljak
f368539447 Some pylint cleaning. 2017-08-22 10:58:30 +02:00
Darko Poljak
314a931b84 Respect cdist log level in emulator. 2017-08-12 21:40:23 +02:00
Darko Poljak
ca1cc0f64a object_id = '/' is invalid 2017-08-10 19:08:44 +02:00
Darko Poljak
e2a1519332 Merge inventory from beta branch. 2017-07-20 22:04:44 +02:00
Darko Poljak
2beb55be54 Remove FIXME comment due to fix appliance 2017-07-19 07:52:57 +02:00
Darko Poljak
126a1812a5 Fix parallel object prepare and run steps. Add nonparallel type marker. 2017-07-15 22:18:20 +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
f9b632eebb Improve listdir. 2017-07-06 17:22:25 +02:00
Darko Poljak
80c3dd7572 Ignore directory entries that begin with dot('.'). 2017-07-06 13:30:57 +02:00
Steven Armstrong
f6e1174adb start moving info log messages to verbose
Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
2017-07-04 23:49:43 +02:00
Darko Poljak
a722f3c634 3rd iteration of logging cleanup. 2017-07-04 23:49:43 +02:00
Darko Poljak
127c05a882 2nd iteration of logging cleanup. 2017-07-04 23:49:43 +02:00
Darko Poljak
248656b81f First iteration of logging cleanup. 2017-07-04 23:49:43 +02:00