Sponsored Content
Full Discussion: Python Name Erro
Top Forums Shell Programming and Scripting Python Name Erro Post 302933513 by infinitydon on Friday 30th of January 2015 06:58:04 AM
Old 01-30-2015
Python Name Erro

Hi There,

I have the following code:

Code:
import time
import paramiko


node_list = ['oj_msp_ts1', 'oj_msp_ts2', 'oj_msp_ts3', 'oj_msp_ts4', 'oj_msp_ts5', 'oj_msp_ts6', 'oj_msp_ts7', 'oj_msp_ts8', 'oj_msp_ts9', 'oj_msp_ts10', 'oj_msp_ts11', 'oj_msp_ts12', 'oj_msp_ts13']
for node in node_list:
    ssh = paramiko.SSHClient()
    ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
    ssh.connect(node, username='lord', password='xxxx')
    variables = {}
    stdin, stdout, stderr = ssh.exec_command("snmpwalk -v1 localhost -c public .1.3.6.1.4.1.193.126.3.6.1.1.1.1.7.5 | awk '{print $NF}'")
    variables[node + "_pull_first"] = stdout.read().strip()
    print str(oj_msp_ts1_pull_first)
    ssh.close()

But for some reason which I have been thinking about for 2 days now, it keeps giving the following error:

NameError: name 'oj_msp_ts1_pull_first' is not defined

This is quite funny to figure out and am somehow surprised that am having issue with (it should be easy to figure out, it's just a couple of lines).

Any input will be appreciated.

Moderator's Comments:
Mod Comment Double posts are not allowed.

Last edited by zaxxon; 01-30-2015 at 08:42 AM..
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

scp syntax erro

hi all i'm getting the following syntax error when i'm running the scripts,can any one pls explain : warning: Connecting to /transfer/common/utilities/99990 failed: No address associated to the name Copying via cmd: scp -Q ... (1 Reply)
Discussion started by: bkan77
1 Replies

2. UNIX for Dummies Questions & Answers

help boot system erro

being nosey on sons laptop and set a password and now need to undo this but its in the boot system :eek::eek::eek: (4 Replies)
Discussion started by: hempel
4 Replies

3. Linux

After famous ORA-12514 error, another erro TNS-12535

Recently I was struggling to resolve ORA-12514 error, after I solved that there is a another error "TNS-12535: TNS: operation timed out". For your information in my machine I have disabled firewall & also added SQLNET.EXPIRE_TIME = 10. But the problem is still persists. Again all your help is... (2 Replies)
Discussion started by: yajneshilu
2 Replies

4. Red Hat

Erro in Installing OPENOFFICE SOFTWARE

Dear All I want to install openoffice on my redhat 5.1 linux os. open office folder is already extracted on Desktop. #cd Desktop/OOO310_m11_native_packed-2_en-US.9399 #./setup After run the setup command, i am getting the Error mentioned below.Please any body can help me. ERROR:- ... (1 Reply)
Discussion started by: sahu.tapan
1 Replies

5. UNIX for Advanced & Expert Users

Erro in generating executable file in PRO*C

Good day to everyone. Im new to pro*c and my boss gave me an assignment regarding oracle forms which uses User_Exit function encoded in pro*c. I already compiled the enhanced pro*c code and generated .c file. The problem was, I cannot make an executable file from the generated .c file. ... (6 Replies)
Discussion started by: pedro.penduko
6 Replies

6. Ubuntu

erro while installing new program

Hi, I am using ubuntu 12.04 and everytime I installed a new program I get except from the error message I have no problem. I mean it does install the progrm, and I can use it. but still everytime I installed a program I get that error message, what is the reason for this? (3 Replies)
Discussion started by: programAngel
3 Replies

7. Shell Programming and Scripting

**python** unable to read the background color in python

I am working on requirement on spreadsheet in python scripting. I have a spreadsheet containing cell values and with background color. I am able to read the value value but unable to get the background color of that particular cell. Actually my requirement is to read the cell value along... (1 Reply)
Discussion started by: giridhar276
1 Replies

8. Shell Programming and Scripting

Sh_sin_bloqTarjeta.sh[15]: test: argument expected erro

Hello good day you can tell me why this command gives me error if ; then sh_sin_bloqTarjeta.sh: test: argument expected (2 Replies)
Discussion started by: tricampeon81
2 Replies

9. Programming

Create a C source and compile inside Python 1.4.0 to 3.7.0 in Python for ALL? platforms...

Hi all... As you know I like making code backwards compatible for as many platforms as possible. This Python script was in fact dedicated for the AMIGA A1200 using Pythons 1.4.0, 1.5.2, 1.6.0, 2.0.1, and 2.4.6 as that is all we have for varying levels of upgrades from a HDD and 4MB FastRam... (1 Reply)
Discussion started by: wisecracker
1 Replies
IDLE(1) 						      General Commands Manual							   IDLE(1)

NAME
IDLE - An Integrated DeveLopment Environment for Python SYNTAX
idle [ -dins ] [ -t title ] [ file ...] idle [ -dins ] [ -t title ] ( -c cmd | -r file ) [ arg ...] idle [ -dins ] [ -t title ] - [ arg ...] DESCRIPTION
This manual page documents briefly the idle command. This manual page was written for Debian because the original program does not have a manual page. For more information, refer to IDLE's help menu. IDLE is an Integrated DeveLopment Environment for Python. IDLE is based on Tkinter, Python's bindings to the Tk widget set. Features are 100% pure Python, multi-windows with multiple undo and Python colorizing, a Python shell window subclass, a debugger. IDLE is cross-plat- form, i.e. it works on all platforms where Tk is installed. OPTIONS
-h Print this help message and exit. -n Run IDLE without a subprocess (see Help/IDLE Help for details). The following options will override the IDLE 'settings' configuration: -e Open an edit window. -i Open a shell window. The following options imply -i and will open a shell: -c cmd Run the command in a shell, or -r file Run script from file. -d Enable the debugger. -s Run $IDLESTARTUP or $PYTHONSTARTUP before anything else. -t title Set title of shell window. A default edit window will be bypassed when -c, -r, or - are used. [arg]* and [file]* are passed to the command (-c) or script (-r) in sys.argv[1:]. EXAMPLES
idle Open an edit window or shell depending on IDLE's configuration. idle foo.py foobar.py Edit the files, also open a shell if configured to start with shell. idle -est "Baz" foo.py Run $IDLESTARTUP or $PYTHONSTARTUP, edit foo.py, and open a shell window with the title "Baz". idle -c "import sys; print sys.argv" "foo" Open a shell window and run the command, passing "-c" in sys.argv[0] and "foo" in sys.argv[1]. idle -d -s -r foo.py "Hello World" Open a shell window, run a startup script, enable the debugger, and run foo.py, passing "foo.py" in sys.argv[0] and "Hello World" in sys.argv[1]. echo "import sys; print sys.argv" | idle - "foobar" Open a shell window, run the script piped in, passing '' in sys.argv[0] and "foobar" in sys.argv[1]. SEE ALSO
python(1). AUTHORS
Various. 21 September 2004 IDLE(1)
All times are GMT -4. The time now is 04:34 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy