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

Suggestions: parsing_introspection_data.py #2

Open
psachin opened this issue Jan 30, 2017 · 1 comment
Open

Suggestions: parsing_introspection_data.py #2

psachin opened this issue Jan 30, 2017 · 1 comment

Comments

@psachin
Copy link

psachin commented Jan 30, 2017

When script is run w/o argument. It should throw hint that is expects an argument in form if file.

psachin@nubia:[master :) ]$ python parsing_introspection_data.py 
Traceback (most recent call last):
  File "parsing_introspection_data.py", line 14, in <module>
    with open(sys.argv[1]) as data_file:
IndexError: list index out of range

Output not in pretty table form?

psachin@nubia:[master :) ]$ python parsing_introspection_data.py instackenv.json
1: nodes
Enter one numeric value: 1
[{'arch': 'x86_64', 'mac': ['2c:c2:60:57:0f:54'], 'pm_user': 'admin', 'cpu': '2', 'pm_addr': '10.10.10.11', 'pm_type': 'pxe_ipmitool', 'pm_password': 'redhat', 'disk': '25', 'memory': '8192'}, {'arch': 'x86_64', 'mac': ['2c:c2:60:12:57:c4'], 'pm_user': 'admin', 'cpu': '2', 'pm_addr': '10.10.10.12', 'pm_type': 'pxe_ipmitool', 'pm_password': 'redhat', 'disk': '25', 'memory': '8192'}, {'arch': 'x86_64', 'mac': ['2c:c2:60:2f:a4:66'], 'pm_user': 'admin', 'cpu': '2', 'pm_addr': '10.10.10.13', 'pm_type': 'pxe_ipmitool', 'pm_password': 'redhat', 'disk': '25', 'memory': '8192'}]
@psachin
Copy link
Author

psachin commented Jan 30, 2017

psachin@nubia:[master :) ]$ python parsing_introspection_data.py instackenv.json
1: nodes
Enter one numeric value: 2
Traceback (most recent call last):
  File "parsing_introspection_data.py", line 110, in <module>
    input_validation()
  File "parsing_introspection_data.py", line 106, in input_validation
    check(int(inputvalues))
  File "parsing_introspection_data.py", line 98, in check
    if (options[input_values] == 'extra' or options[input_values] == 'inventory'):
KeyError: 2

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

1 participant