progrium / ginkgo

Python service microframework
http://ginkgo.readthedocs.org
MIT License
325 stars 48 forks source link

Imported 3rd party modules equals None #75

Open darvin opened 12 years ago

darvin commented 12 years ago
import random
from ginkgo.core import Service
from ginkgo.runner import ControlInterface

class SomeService(Service):

    def do_start(self):
        print random.randint(0,1)

ginkgo test_managed_app2.conf.py                           [ruby-1.9.2-p320]
Starting process with test_managed_app2.conf.py...
2012-07-27 15:15:44,946    INFO zmq_services: Connecting to REP socket with address tcp://0.0.0.0:1112
2012-07-27 15:15:44,946    INFO zmq_services: Binding to REP socket with address tcp://0.0.0.0:2632
Traceback (most recent call last):
  File "/Users/darvin/Projects/ss9/Python/Heyghoge/pyenv/lib/python2.7/site-packages/gevent/greenlet.py", line 390, in run
    result = self._run(*self.args, **self.kwargs)
  File "/Users/darvin/Projects/ss9/Python/Heyghoge/src/base_application.py", line 223, in _ticking
    self.handle_tick()
  File "/Users/darvin/Projects/ss9/Python/Heyghoge/src/test_managed_app2.conf.py", line 10, in handle_tick
    self.health.load += random.randint(0,10)
AttributeError: 'NoneType' object has no attribute 'randint'
<Greenlet at 0x10fff4550: <bound method TestManagedApp2._ticking of <<run_path>.TestManagedApp2 object at 0x10fffba90>>> failed with AttributeError