Python Name Erro


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Python Name Erro
# 1  
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..
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

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. 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

7. 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

8. 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

9. 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
Login or Register to Ask a Question