Hey Guys, I am trying to get a python script running but I get the following error:
atexit.register(atexit_handler) NameError: global name 'atexit' is not defined
A Google search doesn't really help me, except confirm that I don't know anything about python:)
Anyone got any ideas? Thanks, jlc
On Sat, Feb 27, 2010 at 3:46 PM, Joseph L. Casale <jcasale@activenetwerx.com
wrote:
Hey Guys, I am trying to get a python script running but I get the following error:
atexit.register(atexit_handler) NameError: global name 'atexit' is not defined
A Google search doesn't really help me, except confirm that I don't know anything about python:)
Anyone got any ideas? Thanks, jlc
Try the python mailing list, irc channel, support area of the site you downloaded the script, or any other place where it would be even remotely on-topic.
On 27 February 2010 20:46, Joseph L. Casale jcasale@activenetwerx.com wrote:
atexit.register(atexit_handler) NameError: global name 'atexit' is not defined
Have you remembered import atexit ?
A Google search doesn't really help me, except confirm that I don't know anything about python:)
http://www.google.co.uk/search?q=python+atexit http://docs.python.org/library/atexit.html http://python.active-venture.com/lib/atexit-example.html http://www.python.org/doc/3.0.1/library/atexit.html
Or even http://mail.python.org/mailman/listinfo/python-list
Ben
Have you remembered import atexit ?
I did see the python docs link and saw that line, this script for cluster server is known to work as is. Although it lacked the import, I already tried that and it never helped, which is what confirmed I didn't know squat wrt to python:) The cluster list has lower volume, so I will just have to wait and see what the guys there have to say.
Thanks for the idea though, jlc
On 27 February 2010 20:56, Joseph L. Casale jcasale@activenetwerx.com wrote:
I did see the python docs link and saw that line, this script for cluster server is known to work as is.
I haven't got ready access to a CentOS box - what version of Python are you using?
atexit is only available in v2.1.3 and later
Ben
On Sat, 2010-02-27 at 20:46 +0000, Joseph L. Casale wrote:
Hey Guys, I am trying to get a python script running but I get the following error:
atexit.register(atexit_handler)
NameError: global name 'atexit' is not defined
A Google search doesn't really help me, except confirm that I don't know anything about python:)
Anyone got any ideas? Thanks, jlc
--- This is a tad newer but should give you a clue on using "atexit". Somewhere in the script there is a error. Prolly a function in it somewhere. Look for what the script is cleaning up or attempting to.
John
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
On Sat, 2010-02-27 at 20:46 +0000, Joseph L. Casale wrote:
Hey Guys, I am trying to get a python script running but I get the following error:
atexit.register(atexit_handler)
NameError: global name 'atexit' is not defined
A Google search doesn't really help me, except confirm that I don't know anything about python:)
Anyone got any ideas? Thanks, jlc
---
This is a tad newer but should give you a clue on using "atexit". Somewhere in the script there is a error. Prolly a function in it somewhere. Look for what the script is cleaning up or attempting to.
Sorry about that...
http://www.python.org/doc/2.5.2/lib/module-atexit.html
Which I forgot to post but Benjamin already linked it to you, opps.
John
Sorry about that...
http://www.python.org/doc/2.5.2/lib/module-atexit.html
Which I forgot to post but Benjamin already linked it to you, opps.
Well after rereading it I see that the second note of recommended things not to do has been done:) Given I don't python, I dare not criticize:) Hopefully the cluster list has some suggestions, there are people running some variant of it, and it's a perfect solution for my need:(
Digressing a bit, but what's python got over Perl, anything? I am not sure how much work is involved, but I might have a look at writing something fast in Perl, all I need to do is drop a port on a procurve to fence IO using snmp v3. SNMP::Util looks pretty basic?
Given I don't need broad support, I can probably just hack something as I only use procurves.
Thanks guys
On 27 February 2010 22:56, Joseph L. Casale jcasale@activenetwerx.com wrote:
there are people running some variant of it, and it's a perfect solution for my need:(
How did you get the script onto your box? Python can be very picky with whitespace.
Ben
On 28 Feb 2010, at 01:21, "Joseph L. Casale" jcasale@activenetwerx.com wrote:
I just browsed the git repo at rh's site and used wget with a -O.
What's the URL? Determined to get it working now! :-)
Ben
What's the URL? Determined to get it working now! :-)
Ben, Its http://git.fedorahosted.org/git/fence.git and down in there is a fence_ifmib.py.
Thanks! jlc
Its http://git.fedorahosted.org/git/fence.git and down in there is a fence_ifmib.py.
Sorry hit send to fast. You'll also need the files that the cluster group sticks in /usr/lib/fence such as fencing.py|pyc|pyo and fencing_snmp.py|pyc|pyo
Thanks
On Sat, Feb 27, 2010 at 5:56 PM, Joseph L. Casale jcasale@activenetwerx.com wrote:
Sorry about that...
http://www.python.org/doc/2.5.2/lib/module-atexit.html
Which I forgot to post but Benjamin already linked it to you, opps.
Well after rereading it I see that the second note of recommended things not to do has been done:) Given I don't python, I dare not criticize:) Hopefully the cluster list has some suggestions, there are people running some variant of it, and it's a perfect solution for my need:(
Digressing a bit, but what's python got over Perl, anything? I am not sure how much work is involved, but I might have a look at writing something fast in Perl, all I need to do is drop a port on a procurve to fence IO using snmp v3. SNMP::Util looks pretty basic?
Given I don't need broad support, I can probably just hack something as I only use procurves.
--- Check this out this looks pretty easy at least to me: src.rpm Module: http://pysnmp.sourceforge.net/
Link on how to use the Module. http://www.python.org/pyvault/SRPMS/repodata/repoview/python-snmp-0-3.4.3-1....
John
On Sat, Feb 27, 2010 at 2:56 PM, Joseph L. Casale jcasale@activenetwerx.com wrote:
Sorry about that...
http://www.python.org/doc/2.5.2/lib/module-atexit.html
Which I forgot to post but Benjamin already linked it to you, opps.
Well after rereading it I see that the second note of recommended things not to do has been done:) Given I don't python, I dare not criticize:) Hopefully the cluster list has some suggestions, there are people running some variant of it, and it's a perfect solution for my need:(
Digressing a bit, but what's python got over Perl, anything? I am not sure how much work is involved, but I might have a look at writing something fast in Perl, all I need to do is drop a port on a procurve to fence IO using snmp v3. SNMP::Util looks pretty basic?
Given I don't need broad support, I can probably just hack something as I only use procurves.
Why are you reading Python 2.5 documentation if you're running your so-called "stock 2.4"?
Please post both output of the
python --version uname -a
and post the Python error message.
If you want help with the code, post code - or put it sock in it.
It's off topic and unsolicited noise - which means you're wasting our bandwidth.
The module is a file
atexit.py
which lives on my machine in it's "stock" location
/usr/lib/python2.4
If you have a 64 bit machine, then it's /usr/lib64/python2.4.
EIther you have the atexit.py file or you don't.
If you don't have it, then go get it by downloading the source code Python 2.4 from the http://www.python.org.
And please, either put up or shut up.
Agile Aspect wrote:
EIther you have the atexit.py file or you don't.
If you don't have it, then go get it by downloading the source code Python 2.4 from the http://www.python.org.
atexit.py should be part of the base python RPM in EL5
# rpm -qf /usr/lib/python2.4/atexit.py python-2.4.3-27.el5
On 28 February 2010 06:54, John R Pierce pierce@hogranch.com wrote:
atexit.py should be part of the base python RPM in EL5
# rpm -qf /usr/lib/python2.4/atexit.py python-2.4.3-27.el5
Did this get solved in the end?
Ben
Did this get solved in the end?
Ben
Nope:) I started writing a Perl script to accomplish what I need yesterday. Given I have zero experience with python, it was the easier solution although I would have loved to stick with a provided solution in the event I end up overlooking something.
Thanks for the effort none the less, jlc