Talk driven experimentation

Jonathan Hogg <[email protected]> Sat, 09 Feb 2002 00:06:08 +0000
Newsgroups gmane.comp.sysutils.ark.devel
Organization One Good Idea Ltd.
Message-ID <B88A1870.488A%[email protected]>
Hey all,

I'm experimenting with some changes to the ARK engine based on stuff I'm
doing for the UKUUG talk next week.

I wrote a couple of things that seemed obvious to me in the slides, then
went to test them and they failed. This suggested to me that either a) the
engine needed changing, or b) I'm way off.

So I'm asking here if you guys think I'm way off.

The first change is that I tried adding a code field to a <host>, for
example <reboot>, with the expectation that doing something like:

    % ark host slimy reboot

would reboot 'slimy'. Unfortunately, this isn't what happens. The engine
gets it's pants in a twist over the host context and the proxy host. The
default thing is for it to decide that this action needs to be run on all
hosts for the "thing" slimy. It doesn't realise that if the "thing" is
itself a host, the likely intended action is to run the code on that host.
So I have made a small change to the engine to do this (in thing.py:
ArkResult.__inner_call__).

The second thing I've done is remove a couple of error checks out of
ArkControl (control.py). I wanted to be able to experiment with "scripting"
ARK straight from the Python prompt. So I added the arkbase to my PYTHONPATH
with the expectation that I'd be able to do stuff like:

    >>> import ark.host
    >>> hosts = ark.host.ArkHostsMgr()
    >>> slimy = hosts.lookup('slimy')

Except that doesn't work as the ArkControl singleton hasn't been initialised
with a command line so it barfs on any attempt to get the value of an
option.

As far as I could make out, there's no particular reason for it to do this
as the options dictionary exists and gains values from other sources (the
environment, the profile, direct setting etc.). So I pulled out the test
from 'isSet' so that I could do the above.

I'm not going to commit anything just yet, but I wondered if I'd missed
something compelling or was wandering down a bogus path. In particular I
need to know if I'm way off as if so I'll have to change my slides ;-)

(PS: ARK runs fine on Mac OS X, so I can work on the sofa in PowerPoint
editing slides, edit XML files in BBEdit, then switch to the Terminal and
fire off an ark command which wirelessly ssh-es into my other portable
sitting upstairs and instructs it to do something. Very groovy - expect to
see this magic at the talk.)

:-j

-- 
jonathan hogg, one good idea ltd, 131 queen margaret dr., glasgow g20 8pd
http://www.onegoodidea.com/ tel:+44-(0)7976-614338 fax:+44-(0)7970-537451