summaryrefslogtreecommitdiffstats
path: root/doc/client/debugging.txt
blob: 06e388840ae30807df6ece569f7823729fa00a79 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
.. -*- mode: rst -*-

.. _client-debugging:

================
Client Debugging
================

When working on the Bcfg2 client, it is helpful to employ a few specific
techniques to isolate and remedy problems.

First, running the client with the -f flag allows configuration from a
local file, rather than querying the server. This helps rule out server
configuration problems, and allows for rapid development. For example:
``bcfg2 -f test-config.conf`` with the following test-config.conf:

.. code-block:: rst

    <Configuration>
        <Bundle name="ssh-tests">
            <Service type="launchd" name="com.openssh.sshd" status="on" />
        </Bundle>
    </Configuration>

Next, it is important to look at the interactive mode. This is similar
to the interactive mode on the server and provides an interactive
Python interpreter with which one may manipulate all the objects in
the client. It will setup all the infrastructure so you will have the
appropriate objects to play with. It will run the client through once,
then present you with an interpreter. Try it out with: ``python -i
/usr/bin/bcfg2`` or, for more fun, a local config file and also enable
Debugging and Verbose output with `-d` and `-v`, yielding ``python -i
/usr/bin/bcfg2 -d -v -f test-config.conf``.

Now we just explore; use ``dir()`` to examine different objects in the
client, or run a reconfiguration again by calling `client.run()`