Commit graph

111 commits

Author SHA1 Message Date
Darko Poljak
750c71fb5a Minor refactoring and remove code duplication 2021-04-07 10:25:26 +02:00
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
Steven Armstrong
ea0126dd81 Make local state dir available to custom remote scripts
Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
2021-03-05 16:11:49 +01:00
89b6215115 Clarify stdin input
Resolve #836.
2020-09-21 09:04:05 +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
e67215f93d Merge branch 'lint/no-python-shebangs' into 'master'
Remove unnecessary Python shebangs

See merge request ungleich-public/cdist!897
2020-06-21 17:53:44 +02:00
Dennis Camera
ce07021580 Do not subclass object 2020-06-21 16:53:47 +02:00
Dennis Camera
a6a3fb40bf Remove unnecessary Python shebangs 2020-06-21 16:03:09 +02:00
Darko Poljak
59b98091d7 Adapt; update docs and code style 2020-06-13 13:44:01 +02:00
Steven Armstrong
57e352cd1e log server is also usefull for cdist config
Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
2020-06-13 13:44:01 +02:00
Dennis Camera
747c6b1076 Respect NO_COLOR environment variable 2020-06-03 22:17:52 +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
3d3b59ab87 Add pycodestyle ignores 2019-11-27 14:59:25 +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
10a29ca9e6 Fix pycodestyle issue 2019-05-05 00:03:04 +02:00
Darko Poljak
edfaa65d2b Detect dependency cycle as soon as possible 2019-05-01 14:19:08 +02:00
Darko Poljak
087066687c Report explorer error better
Fixes #766
2019-04-20 14:30:28 +02: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
Darko Poljak
6acf6f64dc Add timestamp to log messages. 2018-09-23 20:36:57 +02:00
Darko Poljak
f09765a03a Improve error reporting. 2018-04-17 20:06:20 +02:00
Darko Poljak
b0c5bc793d Fix "label empty or too long" error #645 2018-03-09 09:58:49 +01:00
Darko Poljak
cf36aece7d [BETA] bug: error info lost with parallel (option -j) #632 2018-02-25 23:48:53 +01:00
Darko Poljak
4d39b6af51 Add -4 and -6 params to force IPv4, IPv6 addresses respectively. 2018-02-15 20:33:36 +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
764ea49904 Log more data. 2017-09-17 20:30:07 +02:00
Darko Poljak
ac04edc233 Change path removal suitable for integration and normal run. 2017-09-14 09:53:16 +02:00
Darko Poljak
47d72fb83a Create control path only if needed. 2017-09-14 09:27:27 +02:00
Darko Poljak
08bc38dd0f Log ERROR to stderr and rest to stdout. (#576) 2017-09-13 13:06:06 +02:00
Darko Poljak
1ae5b1732e Fix missing dirs cleanup. 2017-09-10 23:08:21 +02:00
Darko Poljak
2e4c0d3465 Improve dry run logging. 2017-09-07 16:33:22 +02:00
Darko Poljak
28d3466e9d Fix logging dry run line. 2017-09-07 12:32:04 +02:00
Darko Poljak
cb38354df3 Run cleanup commands in quiet mode for DEBUG, TRACE. 2017-09-07 12:10:17 +02:00
Darko Poljak
e0a4fc4ea7 verbose -> info 2017-09-07 11:58:19 +02:00
Darko Poljak
dd48c82656 Log 'Processing' line even if dry run. 2017-09-07 11:30:02 +02:00
Darko Poljak
136f2ecd87 Add helpers for cdist config/install integration. (#551)
Implement simple integration API.
2017-09-01 14:08:50 +02:00
Darko Poljak
bdee7273af Configfile (#559)
Add cdist configuration/config file support.
2017-08-30 23:02:17 +02:00
Darko Poljak
f368539447 Some pylint cleaning. 2017-08-22 10:58:30 +02:00
Philippe Gregoire
61b52ac806 Set default remote_cmds_cleanup_pattern
Fixes an exception when --remote-copy and --remote-exec are used.
2017-08-14 16:13:57 -04:00
Philippe Gregoire
7b0b3d9415 Fix remote cmds cleanup
When --remote-copy and --remote-exec are provided,
args.remote_cmds_cleanup_pattern is not set.

This patches fixes the evaluation of args.remote_cmds_cleanup_pattern
and prevents cdist from throwing an exception when --remote-copy
and --remote-exec are used.
2017-08-14 14:25:19 -04:00
Darko Poljak
75fe3272b3 Add file locking for -j parallel execution. 2017-08-13 12:26:20 +02:00
Darko Poljak
2b0e8160cf Merge pull request #543 from darko-poljak/ssh-mux-sigpipe
Fix ssh connection multiplexing race condition #542
2017-08-10 23:42:16 +02:00
Darko Poljak
68cb13881f Add archiving support. 2017-08-09 16:56:02 +02:00
Darko Poljak
0d734c872d Fix log var assignment. 2017-07-27 09:36:00 +02:00