← Back to team overview

maas-devel team mailing list archive

Re: celeryconfig.py not found

 

On Thursday 06 September 2012 15:53:00 Jeff Marcom wrote:
> On 09/06/2012 02:31 PM, Jeff Marcom wrote:
> > Hello,
> > 
> > I'm trying to use django to delete a node from maas. I'm writing a
> > simple class that will handle this:
> > 
> > #!/usr/bin/env python
> > from argparse import ArgumentParser
> > import djcelery
> > import os
> > os.environ['CELERY_LOADER'] = 'djcelery.loaders.DjangoLoader'
> > os.environ['CELERY_CONFIG_MODULE'] = 'maas_django_control.celeryconfig'
> > os.environ['DJANGO_SETTINGS_MODULE'] = 'maas_django_control.settings'
> > 
> > from maasserver.models import Node
> > 
> > class NodeControl(object):
> >     def __init__(self, hostname):
> >         self.hostname = hostname
> >         self.node = Node.objects.get(self.hostname)
> >     
> >     def delete_node(self):
> >         self.node.delete()
> > 
> > I'm getting the following error when executing:
> >    from provisioningserver.tasks import (
> >   
> >   File "/usr/lib/python2.7/dist-packages/provisioningserver/tasks.py",
> > 
> > line 34, in <module>
> > 
> >     from celeryconfig import DHCP_CONFIG_FILE
> > 
> > Where can I obtain this? It does not exist anywhere on my system.
> > 
> > Thanks
> 
> I was able to retrieve the file. Thanks

You probably want to make sure your PYTHONPATH is set correctly, it needs to 
include /usr/share/maas which is where celeryconfig.py lives.


References