Sorry for late reply, was away from my email most of the day yesterday. On Tuesday 15 Feb 2011 13:39:49 Travis Swicegood wrote: > On Tue, Feb 15, 2011 at 6:47 AM, Michael Gliwinski < > > michael.gliwin...@henderson-group.com> wrote: > > Wouldn't shared functionality rather be something that you use in tasks > > in your fabfile rather than exposing it as tasks on command line? I > > mean, yeah > > there are few small and simple bits like <some_service>.restart or shell > > or even wrappers for some remote commands you may run interactively like > > grep, etc. but most of shared stuff I have is utilities/objects I only > > use in actual fabfile tasks. > > > > ... snip ... > > > > Do you have lot of shared functionality which is exposed directly? > > It's mixed. I have a lot of tasks that are completely useful on their own > or composed as part of a larger package. For example, my rabbitmq tasks[1] > are normally combined into a rabbitmq_init task that sets it up the way I > expect, but it's also nice to be able to interact directly with rabbitmq as > needed.
Hmm, good point. > > Look at it this way: modules/packages with shared functionality have to > > be installed globally (specifically somewhere on Python's path so it's > > accessible > > from different fabfiles), now for example you have a module 'apache' > > which provides ways to start, stop, configure, check status of the > > server, etc.; now > > you have a fabfile which is meant to be used by support group for > > diagnostics > > of various systems including an apache server; if you import that shared > > apache module to get the status command all of a sudden you also get one > > to reconfigure the server. > > You could always import simply the status function from the apache module. > All this code does is scan the fabfile looking for potential modules. If > you don't have an `apache` variable, it's not going to know there's > anything there to scan. Could do now, but not if tasks are self-registering. Suppose at this point I'm actually talking more kind of "ideal to eventually have" design for this feature so it doesn't end up complicated and inconsistent. Anyway, I'm not saying I'd want every fabfile to have long list of "expose this and that imported task" but that eventually even such level of granularity may be useful as an option. In most cases I'd expect "expose everything" as a default and some form of limiting by module to work OK. > All that said, what you're describing here is a selective import of tasks > that retain their module relationship. I love that idea, but I think it's > a next version of this. The first version should be dead simple (either a > variable signifying task modules or some Fabric API for signifying task > modules) and we can start doing things like filtering as a second version. Indeed, don't get me wrong, I agree that functionality (namespaces and explicit tasks) is needed and can be extended later. In any case, I'll try to test the code more throughly in the coming week and provide some feedback and in the meantime we can see what Jeff thinks about this. -- Michael Gliwinski Henderson Group Information Services 9-11 Hightown Avenue, Newtownabby, BT36 4RT Phone: 028 9034 3319 ********************************************************************************************** The information in this email is confidential and may be legally privileged. It is intended solely for the addressee and access to the email by anyone else is unauthorised. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. When addressed to our clients, any opinions or advice contained in this e-mail are subject to the terms and conditions expressed in the governing client engagement leter or contract. If you have received this email in error please notify supp...@henderson-group.com John Henderson (Holdings) Ltd Registered office: 9 Hightown Avenue, Mallusk, County Antrim, Northern Ireland, BT36 4RT. Registered in Northern Ireland Registration Number NI010588 Vat No.: 814 6399 12 ********************************************************************************* _______________________________________________ Fab-user mailing list Fab-user@nongnu.org http://lists.nongnu.org/mailman/listinfo/fab-user