Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iosls.py index error #30

Open
tylersiemers opened this issue Jan 31, 2023 · 1 comment
Open

iosls.py index error #30

tylersiemers opened this issue Jan 31, 2023 · 1 comment

Comments

@tylersiemers
Copy link

tylersiemers commented Jan 31, 2023

Running the following helper script for LNT isols.py
located at src/lntmod

The command referenced in this guide fails on python3.6

https://xrdocs.io/8000/tutorials/8000-software-xr7-giso/#giso-verification

root@NA----DEV-Machine:~/gisobuild/src/lntmod# ./isols.py /root/gisobuild/nsight_builds/builds/N540L_752_v4/giso/ncs540l-golden-x86_64-7.5.2-N540L_752_v4.iso --optional-packages
Traceback (most recent call last):
File "./isols.py", line 28, in
sys.path.append(str(pathlib.Path(file).parents[1]))
File "/usr/lib/python3.6/pathlib.py", line 594, in getitem
raise IndexError(idx)
IndexError: 1

Changing the script to the following works

#!/usr/bin/env python3
# ----------------------------------------------------------------

""" Wrapper script to extract ISO information.

Copyright (c) 2022 Cisco and/or its affiliates.
This software is licensed to you under the terms of the Cisco Sample
Code License, Version 1.1 (the "License"). You may obtain a copy of the
License at

        https://developer.cisco.com/docs/licenses

All use of the material herein must be in accordance with the terms of
the License. All rights not expressly granted by the License are
reserved. Unless required by applicable law or agreed to separately in
writing, software distributed under the License is distributed on an "AS
IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
or implied.

"""

__all__ = ()

from pathlib import Path
import sys

sys.path.append(str(Path(__file__).resolve().parents[1]))
from lnt import tools


if __name__ == "__main__":
    tools.isols(sys.argv[1:])
@NeilKetley
Copy link

Hi Ty,

Thanks for raising this issue. I have created an internal ticket for the issue. We will create a fix using your suggestion and push it through our tests and release process.

Cheers
Neil

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants