Quantcast
Channel: Zenoss Community: Message List
Viewing all articles
Browse latest Browse all 1118

Unable to pass Job class object to dmd.Jobmanager.addJob()

$
0
0

Job class is defined as below

*******************************************************

>>> from Products.Jobber.jobs import SubprocessJob

>>> class TestBackupJob(SubprocessJob):

...     def __init__(self):

...         self.cmd = ['zenbackup']

...         super(SubprocessJob, self).__init__()

...     @classmethod

...     def getJobType(cls):

...         return "Shell Command"

*******************************************************

 

 

Then created object for the class “TestBackupJob”

*******************************************************

>>> tbj_object=TestBackupJob()

*******************************************************

 

 

Then tried to pass the object to Job Manager by the following command

*******************************************************

>>> dmd.JobManager.addJob(tbj_object)

*******************************************************

 

And got the following error log

*******************************************************

Traceback (most recent call last):

  File "<console>", line 1, in <module>

  File "/opt/zenoss/Products/Jobber/manager.py", line 151, in addJob

    job = klass()

  File "/opt/zenoss/lib/python/celery/app/task.py", line 342, in __call__

    return self.run(*args, **kwargs)

  File "/opt/zenoss/Products/Jobber/jobs.py", line 212, in run

    self.log.info("Job %s (%s) received", job_id, self.name)

  File "/opt/zenoss/Products/Jobber/jobs.py", line 90, in log

    logdir = self._get_config('job-log-path')

  File "/opt/zenoss/Products/Jobber/jobs.py", line 83, in _get_config

    raise ValueError("Config option %s is not defined" % key)

ValueError: Config option job-log-path is not defined

*******************************************************

 

Foot Note:

                If we pass class name instead of the object created then gets log as

<Products.Jobber.manager.JobRecord object at 0x835a410>

But the job getting added to Zenoss GUI in PENDING state.

 

Do anyone have pointers on this issue.

 

Thanks.


Viewing all articles
Browse latest Browse all 1118

Trending Articles