seveas / python-hpilo

Accessing the HP iLO XML interface from python

Home Page:https://seveas.github.io/python-hpilo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

use input file to get Licenses Key

hassan-ayo opened this issue · comments

Hi ,
The method get_all_licenses() work fine if I put one ip address on hpilo.Ilo(ip_server, "user", "pwd"),
but if I use a list of ip_address on text file and put a variable on ip_server filed it dosn't work

f = open('list_ip.txt', 'r')
line = f.readline()
while line:
ilo = hpilo.Ilo(str(line), "user", "pwd")
key = ilo.get_all_licenses()
print (key[0]['license_key'])
line = f.readline()

Thank you for the help

f.readline() returns a line with the trailing newline. You'll have to remove that.