PSRP: Improve default logging to ansible.log (#47645)
This commit is contained in:
parent
01d66d4431
commit
bc481c2500
1 changed files with 7 additions and 0 deletions
|
@ -156,8 +156,10 @@ options:
|
||||||
|
|
||||||
import base64
|
import base64
|
||||||
import json
|
import json
|
||||||
|
import logging
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
from ansible import constants as C
|
||||||
from ansible.errors import AnsibleConnectionFailure, AnsibleError
|
from ansible.errors import AnsibleConnectionFailure, AnsibleError
|
||||||
from ansible.errors import AnsibleFileNotFound
|
from ansible.errors import AnsibleFileNotFound
|
||||||
from ansible.module_utils.parsing.convert_bool import boolean
|
from ansible.module_utils.parsing.convert_bool import boolean
|
||||||
|
@ -204,6 +206,11 @@ class Connection(ConnectionBase):
|
||||||
self._shell_type = 'powershell'
|
self._shell_type = 'powershell'
|
||||||
super(Connection, self).__init__(*args, **kwargs)
|
super(Connection, self).__init__(*args, **kwargs)
|
||||||
|
|
||||||
|
if not C.DEFAULT_DEBUG:
|
||||||
|
logging.getLogger('pypsrp').setLevel(logging.INFO)
|
||||||
|
logging.getLogger('requests_credssp').setLevel(logging.INFO)
|
||||||
|
logging.getLogger('urllib3').setLevel(logging.INFO)
|
||||||
|
|
||||||
def _connect(self):
|
def _connect(self):
|
||||||
if not HAS_PYPSRP:
|
if not HAS_PYPSRP:
|
||||||
raise AnsibleError("pypsrp or dependencies are not installed: %s"
|
raise AnsibleError("pypsrp or dependencies are not installed: %s"
|
||||||
|
|
Loading…
Reference in a new issue