StarCluster - Mailing List Archive

Re: development shell - unbound method run_plugin() must be called with Cluster instance

From: Stuart Young <no email>
Date: Thu, 10 Feb 2011 00:30:23 -0500

Hi All,

Fyi, I figured out I needed ClusterManager (not Cluster). Here's the way
to access the ClusterManager **instance** (i.e., not the type):

clus = cluster.ClusterManager(cfg)
cluster.ClusterManager.run_plugin(clus, 'automount', 'smallcluster')


Cheers,

Stuart


On 2/9/2011 6:22 PM, Stuart Young wrote:
> (Sorry - reposting with correct subject)
>
> Hi All,
>
> I'm having some trouble debugging my plugin inside the StarCluster
> development shell.
>
> I've created a plugin called automount.py like so:
>
> class NfsShares (ClusterSetup):
> """
> Automatically mounts external NFS shares on StarCluster nodes
> """
> def __init__(self, head_ip):
> log.info("AutoMount.__init__ Running AutoMount plugin.")
> ...
>
> .. and placed it in the ~/.starcluster/plugins directory and filled in
> the config file as described in the documentation here:
> http://web.mit.edu/stardev/cluster/docs/plugins.html
>
> I started a cluster okay with:
>
> starcluster start smallcluster
>
> But when I come to test my plugin inside the development shell according
> to the following instructions:
>
> 3. Launch the development shell and test your plugin on your small
> test cluster
>
> $ starcluster shell
> [~]|1> cluster.run_plugin('myplugin', 'testcluster', cfg)
>
> ... I run this command inside the shell:
>
> cluster.run_plugin('automount', 'smallcluster', cfg)
>
> ... and get this error message:
>
> AttributeError: 'module' object has no attribute 'run_plugin'
>
> So I tried the cluster.Cluster object since it has the 'run_plugin' method:
>
> cluster.Cluster.run_plugin(cluster.Cluster, 'automount', 'smallcluster',
> cfg)
>
> ... but I get this error message:
>
> TypeError: unbound method run_plugin() must be called with Cluster
> instance as first argument (got type instance instead)
>
> Am I going about this the right way?
>
> Cheers,
>
> Stuart
>
Received on Thu Feb 10 2011 - 00:31:31 EST
This archive was generated by hypermail 2.3.0.

Search:

Sort all by:

Date

Month

Thread

Author

Subject