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

Creating Edge objects doesn't work #202

Closed
gdubicki opened this issue Apr 5, 2021 · 0 comments
Closed

Creating Edge objects doesn't work #202

gdubicki opened this issue Apr 5, 2021 · 0 comments
Labels

Comments

@gdubicki
Copy link
Member

gdubicki commented Apr 5, 2021

The code at:

yield Edge(source=self.resources[identifier_source],
target=self.resources[identifier_target],

...cannot work according to my knowledge (and my IDE) - resources is a method in BaseAPI.

A simple test script:

#!/usr/bin/env python3
from pypuppetdb import connect
from pypuppetdb.QueryBuilder import EqualsOperator

db = connect()
query = EqualsOperator('certname', 'puppetdb01.c.foobar.internal')
edges = db.edges(query=query)
for edge in edges:
    pass

...does in fact fail with:

Traceback (most recent call last):
  File "./test_edges.py", line 8, in <module>
    for edge in edges:
  File "/home/foobar/venv/lib/python3.6/site-packages/pypuppetdb/api.py", line 648, in edges
    yield Edge(source=self.resources[identifier_source],
TypeError: 'method' object is not subscriptable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant