tart / motop

"Top" clone for MongoDB
67 stars 24 forks source link

fixes for replicaSet monitoring #12

Closed UdjinM6 closed 11 years ago

UdjinM6 commented 11 years ago

I've got errors when trying to monitor replicaSet.

First one:

Traceback (most recent call last):
  File "/usr/local/bin/motop", line 5, in <module>
    pkg_resources.run_script('motop==2.6', 'motop')
  File "build/bdist.macosx-10.8-intel/egg/pkg_resources.py", line 492, in run_script
  File "build/bdist.macosx-10.8-intel/egg/pkg_resources.py", line 1357, in run_script
    for name in self._index()[zip_path]:
  File "build/bdist.macosx-10.8-intel/egg/pkg_resources.py", line 47, in exec_
    g[name] = val
  File "<string>", line 1, in <module>
  File "/Library/Python/2.7/site-packages/motop-2.6-py2.7.egg/EGG-INFO/scripts/motop", line 4, in <module>
    import pkg_resources
  File "/Library/Python/2.7/site-packages/motop-2.6-py2.7.egg/libmotop/Motop.py", line 106, in __init__
  File "/Library/Python/2.7/site-packages/motop-2.6-py2.7.egg/libmotop/QueryScreen.py", line 258, in action
  File "/Library/Python/2.7/site-packages/motop-2.6-py2.7.egg/libmotop/QueryScreen.py", line 111, in reset
  File "/Library/Python/2.7/site-packages/motop-2.6-py2.7.egg/libmotop/Server.py", line 155, in replicaSetMembers
NameError: global name 'values' is not defined

But as soon as I fixed that one another one appeared:

Traceback (most recent call last):
  File "/usr/local/bin/motop", line 5, in <module>
    pkg_resources.run_script('motop==2.4', 'motop')
  File "build/bdist.macosx-10.8-intel/egg/pkg_resources.py", line 492, in run_script
  File "build/bdist.macosx-10.8-intel/egg/pkg_resources.py", line 1357, in run_script
    for name in self._index()[zip_path]:
  File "build/bdist.macosx-10.8-intel/egg/pkg_resources.py", line 47, in exec_
    g[name] = val
  File "<string>", line 1, in <module>
  File "/Library/Python/2.7/site-packages/motop-2.4-py2.7.egg/EGG-INFO/scripts/motop", line 4, in <module>
    import pkg_resources
  File "build/bdist.macosx-10.8-intel/egg/libmotop/Motop.py", line 106, in __init__
  File "build/bdist.macosx-10.8-intel/egg/libmotop/QueryScreen.py", line 258, in action
  File "build/bdist.macosx-10.8-intel/egg/libmotop/QueryScreen.py", line 122, in reset
AttributeError: ReplicaSetMemberBlock instance has no attribute 'add'

So I made fix for that too.

hasegeli commented 11 years ago

Thank you for the fix. I will merge it to the version3 branch and update PyPi soon.