-include ignores too many failures. It should only ignore ENOENT, all
others should throw an exception regardless.
Signed-off-by: Jan Lindemann <jan@janware.com>
The entry instance passed to the walk callback contains raw results
of LDAP search operations, i.e. all attribute values are lists, and
all attribute values are bytes. Add the boolean parameters decode and
unroll to walk() as a convenience method to get decoded values. They
default to False, representing current behaviour.
Signed-off-by: Jan Lindemann <jan@janware.com>
Currently the configuration passed to the Connection constructor
needs to contain an ldap_uri entry. Add "uri" as alias, because
ldap_uri for the LDAP config in many contexts represents a tautology
and is left out.
Signed-off-by: Jan Lindemann <jan@janware.com>
- Streamline proj.mk over all projects a little
- Turn the string "jw-build" into a variable which can be overridden from the
environment.
- Add support for JWBDIR_SEARCH_PATH, also overridable from the environment.
Signed-off-by: Jan Lindemann <jan@janware.com>
update_symlink(target, link_name) does the equivalent of ln -sf, i.e.
force replacement of link_name with a new sysmlink, if it existed
before the call.
Signed-off-by: Jan Lindemann <jan@janware.com>
An application based on Cmds will now try to read StringTree
formatted config data from a file $HOME/.<name>rc, and make the data
available via the newly added conf_value() method.
Signed-off-by: Jan Lindemann <jan@janware.com>
log.add_log_file(path) allows to pass a file path log messages will
be written into. Special characters (e.g. console color codes) will
be removed from the messages.
Signed-off-by: Jan Lindemann <jan@janware.com>
The Options constructor takes an options string, parses it and
makes the options available via __getitem__().
Signed-off-by: Jan Lindemann <jan@janware.com>
Do "from . import log" instead of "from jwutils import log". It works
and looks cleaner than a module referencing itself. Not entirely sure
if that's the way to go, I must admit.
Signed-off-by: Jan Lindemann <jan@janware.com>
Add class ShellCmd, an easy API to run shell commands as
async subprocesses, capture their exit status, and have them log to slog().
Signed-off-by: Jan Lindemann <jan@janware.com>
Commit 72d56d9 (Move type argument into config) swapped the order of
arguments in Auth.load(), but the ctor of ldap.Auth didn't follow the
change, fix that.
Signed-off-by: Jan Lindemann <jan@janware.com>
Auth.load() takes a "tp" argument, specifying the Auth module name to
load. In case of jw-devops, this is part of the configuration, which
is also passed as an argument. Make taking 'type' from the config the
default. Note that this changes the prototype.
Signed-off-by: Jan Lindemann <jan@janware.com>
jw-client-devops configures its databases with a set of config keys
which are identical - except for the 'bind_pw' key, which is called
'password'. Allow that, too.
Signed-off-by: Jan Lindemann <jan@janware.com>
ldap.Auth lost a lot of code when jwutils.ldap was introduced, and
rightfully so, because jwutils.ldap contains most of it. OTOH, it was
used wrongly, fix that.
Signed-off-by: Jan Lindemann <jan@janware.com>
MapAttr2Shape is a class which allows processing GraphML files, such
that nodes get added shape attributes understood by the yEd editor,
based on the values of other node attributes. This allows to
programmatically visualize node attributes.
Signed-off-by: Jan Lindemann <jan@janware.com>
jwutils.Bunch is a simple wrapper around a dictionary, which allows
member-type access to to dictionary data.
Signed-off-by: Jan Lindemann <jan@janware.com>
argcomplete takes the arguments added to argparse, and builds bash
completion with it. Add it to all Cmds based executables.
Signed-off-by: Jan Lindemann <jan@janware.com>
- Add coding statement
- Import all modules in one line where possible
- Order: __future__, typing, plain imports, from imports,
janware modules
Signed-off-by: Jan Lindemann <jan@janware.com>