OpenIxia / IxNetwork

A central location for IxNetwork sample scripts and utilities. Please also visit http://openixia.com
MIT License
50 stars 59 forks source link

sample scripts are dos-format and indentation are inconsistent #83

Closed sshuguan closed 4 years ago

sshuguan commented 4 years ago

After install ixnetwork_restpy on Linux (pip install -U --no-cache-dir ixnetwork_restpy) 1) those sample scripts under site-package/ixnetwork_restpy/samples/ have to be converted with "dos2unix". Otherwise they are not runnable by itself. 2) python complains about inconsistent indention at line,
from ixnetwork_restpy.errors import * File "/usr/local/lib/python3.7/site-packages/ixnetwork_restpy/errors.py", line 27 self._message = message ^ TabError: inconsistent use of tabs and spaces in indentation

ajbalogh commented 4 years ago

what version of the package are you using - we are not seeing this issue.

errors indentation

sshuguan commented 4 years ago

$ pip list | grep ixnetwork ixnetwork-restpy 1.0.46 The problem occurs on Linux rather than Windows.

ajbalogh commented 4 years ago

still unable to reproduce. errors indentation

sshuguan commented 4 years ago

Reinstall the package and the "inconsistent indention" is gone. Looks like someone fixed it already. But sample scripts still need "dos2unix" conversion on Linux. here is how to reproduce:

  1. edit file /usr/local/lib/python3.7/site-packages/ixnetwork_restpy/samples/getting_started.py by add line "#!/usr/bin/env python3" as first line
  2. chmod +x /usr/local/lib/python3.7/site-packages/ixnetwork_restpy/samples/getting_started.py
  3. run it $ /usr/local/lib/python3.7/site-packages/ixnetwork_restpy/samples/getting_started.py : No such file or directory 4 $ dos2unix /usr/local/lib/python3.7/site-packages/ixnetwork_restpy/samples/getting_started.py 5 run again $ /usr/local/lib/python3.7/site-packages/ixnetwork_restpy/samples/getting_started.py Traceback (most recent call last): ......
ajbalogh commented 4 years ago

version 1.0.47 will have normalized \n endings for all files in the package.