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
bup-margin(1)						      General Commands Manual						     bup-margin(1)

NAME
bup-margin - figure out your deduplication safety margin SYNOPSIS
bup margin [options...] DESCRIPTION
bup margin iterates through all objects in your bup repository, calculating the largest number of prefix bits shared between any two entries. This number, n, identifies the longest subset of SHA-1 you could use and still encounter a collision between your object ids. For example, one system that was tested had a collection of 11 million objects (70 GB), and bup margin returned 45. That means a 46-bit hash would be sufficient to avoid all collisions among that set of objects; each object in that repository could be uniquely identified by its first 46 bits. The number of bits needed seems to increase by about 1 or 2 for every doubling of the number of objects. Since SHA-1 hashes have 160 bits, that leaves 115 bits of margin. Of course, because SHA-1 hashes are essentially random, it's theoretically possible to use many more bits with far fewer objects. If you're paranoid about the possibility of SHA-1 collisions, you can monitor your repository by running bup margin occasionally to see if you're getting dangerously close to 160 bits. OPTIONS
--predict Guess the offset into each index file where a particular object will appear, and report the maximum deviation of the correct answer from the guess. This is potentially useful for tuning an interpolation search algorithm. --ignore-midx don't use .midx files, use only .idx files. This is only really useful when used with --predict. EXAMPLE
$ bup margin Reading indexes: 100.00% (1612581/1612581), done. 40 40 matching prefix bits 1.94 bits per doubling 120 bits (61.86 doublings) remaining 4.19338e+18 times larger is possible Everyone on earth could have 625878182 data sets like yours, all in one repository, and we would expect 1 object collision. $ bup margin --predict PackIdxList: using 1 index. Reading indexes: 100.00% (1612581/1612581), done. 915 of 1612581 (0.057%) SEE ALSO
bup-midx(1), bup-save(1) BUP
Part of the bup(1) suite. AUTHORS
Avery Pennarun <apenwarr@gmail.com>. Bup unknown- bup-margin(1)
All times are GMT -4. The time now is 05:46 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy