Administrator Guide

21 Python Scripting for Dell Networking N-Series | Version 1.0.1
“tar: no gzip magic” message is
seen while copying the compressed
file to the switch
or
“Unable to unpack archive…”
message is seen while copying the
compressed file to the switch
The method used to compress the file is not acceptable,
and the switch is not able to unpack it. Be sure to
compress the script into a gzipped tar archive, with
either a .tgz or .tar.gz extension as discussed on page
8
of this guide.
To verify whether or not the file was properly
decompressed after copying to the switch, run the show
application filescommand. Any script files that still
show a compress extension (e.g. .tgz or .tar.gz) were
not properly compressed and therefore could not be
decompressed. Be sure to use the instructions on page
8 of this guide to properly compress the file.
Note: As discussed in the copy
command section, the
switch unpacks the file during copying and strips any
“compress” extensions off of the script file.
Script is not running properly using
the start-on-bootparameter.
For example, the script is not able
to contact the TFTP/FTP server or
Telnet outside of itself in the first
few seconds after a reload, when
using start-on-bootto initiate the
script.
The script may be starting too soon, not allowing for the
network to be fully discovered by the switch.
After a switch reload, ports need time to initiate and
connect to the network. Protocols like spanning tree,
DHCP, and LLDP require a short period of time to
discover the network. Stacked switches can take
addition time in completing a discovery.
Scripts should be written to allow time for the switch
ports to be fully functional. This can be done in multiple
ways. Below are two examples.
1. In the beginning of the script, include a “ping” loop to
the desired remote server (e.g. TFTP server) and exit
the loop once the destination is reachable. This is the
recommended method since it allows the script to
initiate and complete in the most efficient manner. It also
requires the least amount of debugging and
maintenance.
2. In the beginning of the script, import the time Python
module and use time.sleep() to hard-code a delay. This
is less efficient than method 1 above, since it is difficult
to determine how long of a delay is needed. Selecting a
duration that is too long adds unnecessary delays in
completing the script. Any duration selected today may
need to be changed at a later date as other influences
change on the network, switch or switch stack.