We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3524cc3 commit 87e76feCopy full SHA for 87e76fe
plugins/inventory/nb_inventory.py
@@ -277,6 +277,17 @@ def _fetch_information(self, url):
277
This is to help determine what might be the issue when encountering an error.
278
Please check issue #294 for more info.
279
"""
280
+ # Prevent inventory from failing completely if the token does not have the proper permissions for specific URLs
281
+ if e.code == 403:
282
+ self.display.display(
283
+ "Permission denied: {0}. This may impair functionality of the inventory plugin.".format(
284
+ url
285
+ ),
286
+ color="red",
287
+ )
288
+ # Need to return mock response data that is empty to prevent any failures downstream
289
+ return {"results": [], "next": None}
290
+
291
raise AnsibleError(to_native(e.fp.read()))
292
293
try:
0 commit comments