Send openstack inventory logs to stderr (#51827)
parent
32fce43311
commit
af9ff07c74
|
@ -0,0 +1,2 @@
|
||||||
|
bugfixes:
|
||||||
|
- openstack inventory plugin - send logs from sdk to stderr so they do not combine with output
|
|
@ -108,6 +108,7 @@ fail_on_errors: yes
|
||||||
'''
|
'''
|
||||||
|
|
||||||
import collections
|
import collections
|
||||||
|
import sys
|
||||||
|
|
||||||
from ansible.errors import AnsibleParserError
|
from ansible.errors import AnsibleParserError
|
||||||
from ansible.plugins.inventory import BaseInventoryPlugin, Constructable, Cacheable
|
from ansible.plugins.inventory import BaseInventoryPlugin, Constructable, Cacheable
|
||||||
|
@ -172,8 +173,10 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
|
||||||
else:
|
else:
|
||||||
config_files = None
|
config_files = None
|
||||||
|
|
||||||
|
# Redict logging to stderr so it does not mix with output
|
||||||
|
# particular ansible-inventory JSON output
|
||||||
# TODO(mordred) Integrate openstack's logging with ansible's logging
|
# TODO(mordred) Integrate openstack's logging with ansible's logging
|
||||||
sdk.enable_logging()
|
sdk.enable_logging(stream=sys.stderr)
|
||||||
|
|
||||||
cloud_inventory = sdk_inventory.OpenStackInventory(
|
cloud_inventory = sdk_inventory.OpenStackInventory(
|
||||||
config_files=config_files,
|
config_files=config_files,
|
||||||
|
|
Loading…
Reference in New Issue