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

1.41.0 - ERROR: "'dict' object has no attribute 'slug'", while: getting Packet devices #68

Open
stewartshea opened this issue Nov 13, 2019 · 0 comments
Labels

Comments

@stewartshea
Copy link

Packet-Python Version: 1.41.0
OS: Fedora 30/31
Python Version: 3.7.5

Hi There!

Possibly this is just a localised issue, but attempting to use the dynamic inventory script for ansible with the packet-python version above spits out the following:

$ ./packet_net.py --refresh-cache
Traceback (most recent call last):
  File "./packet_net.py", line 273, in get_devices_by_project
    self.add_device(device, project)
  File "./packet_net.py", line 354, in add_device
    self.push(self.inventory, device.operating_system.slug, dest)
AttributeError: 'dict' object has no attribute 'slug'
ERROR: "'dict' object has no attribute 'slug'", while: getting Packet devices

Workaround:

  • downgrade to 1.38.1
$ pip uninstall  packet-python
Uninstalling packet-python-1.41.0:
  Would remove:
    /home/sheastewart/.local/lib/python3.7/site-packages/packet/*
    /home/sheastewart/.local/lib/python3.7/site-packages/packet_python-1.41.0.dist-info/*
Proceed (y/n)? y
  Successfully uninstalled packet-python-1.41.0

$ pip install packet-python==1.38.1 --user
Collecting packet-python==1.38.1
  Using cached https://files.pythonhosted.org/packages/94/54/24f853fba818502b5136fb1e8e01952b9b04c8588cdb85ff03d77e764f1c/packet_python-1.38.1-py2.py3-none-any.whl
Requirement already satisfied: requests in /usr/lib/python3.7/site-packages (from packet-python==1.38.1) (2.22.0)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /usr/lib/python3.7/site-packages (from requests->packet-python==1.38.1) (3.0.4)
Requirement already satisfied: idna<2.9,>=2.5 in /usr/lib/python3.7/site-packages (from requests->packet-python==1.38.1) (2.8)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /usr/lib/python3.7/site-packages (from requests->packet-python==1.38.1) (1.25.3)
Installing collected packages: packet-python
Successfully installed packet-python-1.38.1

$ ./packet_net.py --list
{
  "uid": [
    "x.x.x.x"
  ],
...

Thought I would post this issue in case someone else runs across it or if there is an issue at play that is outside of my system.

@displague displague linked a pull request Jul 9, 2020 that will close this issue
@displague displague added the bug label Jul 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants