Posted on July 3, 2019 10:54 am
 |  Asked by Armando Reyes
 |  79 views
0
0
Print Friendly, PDF & Email

Hello,

I’m trying to set up my ztpserver to add a very basic config to the new switches. I have almost all configured. The switch can get to the server and download the bootstrap however when it tries to run the script it fails and send this log:

Config script exited with an error. Error code: 1. Output: SyslogManager: adding localhost handler.
Retrieving config from server. GET http://10.32.48.18:8080/bootstrap/config. Server response to GET config: contents={u’logging’: [], u’xmpp’: {}}. ERROR:
Bootstrap process failed because of unknown exception:. too many values to unpack. . Traceback (most recent call last):.
File “/tmp/zt-download”, line 1400, in . main().

any guide will be much appreciated….I have no clue on python btw…

Thanks!

1
Posted by Lokesh Charora
Answered on July 4, 2019 3:32 am

Hello Armando,

Not sure regarding what is there in ZTP script , But as per the error “too many values to unpack”, you might be loading multiple outputs in few arguments. Let me clear this from a simple example :

Following code work, and prints 1, then 2, then 3

def returnATupleWithThreeValues():
return (1,2,3)
a,b,c = returnATupleWithThreeValues()
print a
print b
print c
But this raises your error

def returnATupleWithThreeValues():
return (1,2,3)
a,b = returnATupleWithThreeValues()
print a
print b
raises

Traceback (most recent call last):
File “c.py”, line 3, in ?
a,b = returnATupleWithThreeValues()
ValueError: too many values to unpack

Example is taken from : https://stackoverflow.com/questions/1479776/too-many-values-to-unpack-exception.

If you can send your script across, I might be able to help.

Hello Lokesh,

I really appreciate you took some time to answer this. I decided to go in a different directions by using direct commands in the boot file instead of a Python script since right now I dont have any experience programming….I hope I can get the knowledge to use python in the future.

I will attach the script I was trying to use that came with the ztpserver installation package in case you are still interested in taking a look…..is long btw, but if you review and find something wrong I will appreciate any feedback since I want to learn about this world.

Thanks again!

(Armando Reyes at July 8, 2019 1:10 am)
0
Posted by Armando Reyes
Answered on July 8, 2019 1:16 am

Hello Lokesh, attached is the code…I added a comment to your answer but not sure if it did go through. I was explaining that I decided to use direct commands instead of a python script due to my lack of knowledge but in case you still want to check the script Im attaching it…it came with the ztpserver installation package that I used. Any feedback please let me know, it’ll be good to start on this programming world.

Thanks!

Attachments:

Post your Answer

You must be logged in to post an answer.