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

update_host_groups example fails on AR 11.10 with AttributeError(key) error in steelscript/common/datastructures.py #6

Closed
gwenblum opened this issue Nov 25, 2020 · 1 comment · Fixed by #7
Assignees

Comments

@gwenblum
Copy link
Member

This script example run against an AR instance version 11.10 raises AttributeError(key) error in steelscript/common/datastructures.py

repro:
~/steelscript-workspace# python examples/appresponse-examples/update_host_groups.py -u admin -p admin --operation show appresponse-ip-address

output:
/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py:1020: InsecureRequestWarning: Unverified HTTPS request is being made to host '10.10.10.55'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
InsecureRequestWarning,
Traceback (most recent call last):
File "/src/steelscript/steelscript/common/datastructures.py", line 314, in getattr
return self.getitem(key)
KeyError: 'hosts'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "examples/appresponse-examples/update_host_groups.py", line 159, in
app.run()
File "/src/steelscript/steelscript/common/app.py", line 35, in run
self.parse(sys.argv[1:])
File "/src/steelscript/steelscript/commands/steel.py", line 310, in parse
self.main()
File "examples/appresponse-examples/update_host_groups.py", line 98, in main
for hg in self.appresponse.classification.get_hostgroups()
File "examples/appresponse-examples/update_host_groups.py", line 98, in
for hg in self.appresponse.classification.get_hostgroups()
File "/src/steelscript/steelscript/common/datastructures.py", line 316, in getattr
raise AttributeError(key)
AttributeError: hosts

@gwenblum
Copy link
Member Author

Due to some host groups records not having any hosts in their definition

@gwenblum gwenblum self-assigned this Nov 25, 2020
@gwenblum gwenblum linked a pull request Nov 25, 2020 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant