summaryrefslogtreecommitdiff
path: root/cloud/lxd
diff options
context:
space:
mode:
authorHiroaki Nakamura <hnakamur@gmail.com>2016-07-01 23:23:14 +0900
committerHiroaki Nakamura <hnakamur@gmail.com>2016-07-01 23:23:14 +0900
commit0140e50d551967ebc74238cacd9697ae2bbd2c02 (patch)
tree592dd451bc59a643b7abcd3d073310a37136f43f /cloud/lxd
parent0b55ce4cc3b2e42a6a15c9bdce5ac2ecca823e8e (diff)
downloadansible-modules-extras-0140e50d551967ebc74238cacd9697ae2bbd2c02.tar.gz
Remove debug parameter and add logs in return object when invoked with -vvvv
Diffstat (limited to 'cloud/lxd')
-rw-r--r--cloud/lxd/lxd_container.py15
-rw-r--r--cloud/lxd/lxd_profile.py14
2 files changed, 5 insertions, 24 deletions
diff --git a/cloud/lxd/lxd_container.py b/cloud/lxd/lxd_container.py
index fefc7c14..77fa7bc1 100644
--- a/cloud/lxd/lxd_container.py
+++ b/cloud/lxd/lxd_container.py
@@ -133,12 +133,6 @@ options:
- If trust_password is set, this module send a request for
authentication before sending any requests.
required: false
- debug:
- description:
- - If this flag is true, the logs key are added to the result object
- which keeps all the requests and responses for calling APIs.
- required: false
- default: false
notes:
- Containers must have a unique name. If you attempt to create a container
with a name that already existed in the users namespace the module will
@@ -250,7 +244,7 @@ lxd_container:
sample: "stopped"
logs:
descriptions: The logs of requests and responses.
- returned: when the debug parameter is true and any requests were sent.
+ returned: when ansible-playbook is invoked with -vvvv.
actions:
description: List of actions performed for the container.
returned: success
@@ -316,7 +310,7 @@ class LXDContainerManagement(object):
self.url = self.module.params['url']
self.key_file = self.module.params.get('key_file', None)
self.cert_file = self.module.params.get('cert_file', None)
- self.debug = self.module.params['debug']
+ self.debug = self.module._verbosity >= 4
try:
self.client = LXDClient(
self.url, key_file=self.key_file, cert_file=self.cert_file,
@@ -528,6 +522,7 @@ class LXDContainerManagement(object):
state_changed = len(self.actions) > 0
result_json = {
+ 'log_verbosity': self.module._verbosity,
'changed': state_changed,
'old_state': self.old_state,
'actions': self.actions
@@ -608,10 +603,6 @@ def main():
),
trust_password=dict(
type='str',
- ),
- debug=dict(
- type='bool',
- default=False
)
),
supports_check_mode=False,
diff --git a/cloud/lxd/lxd_profile.py b/cloud/lxd/lxd_profile.py
index 351e280e..8158a401 100644
--- a/cloud/lxd/lxd_profile.py
+++ b/cloud/lxd/lxd_profile.py
@@ -93,12 +93,6 @@ options:
- If trust_password is set, this module send a request for
authentication before sending any requests.
required: false
- debug:
- description:
- - If this flag is true, the logs key are added to the result object
- which keeps all the requests and responses for calling APIs.
- required: false
- default: false
notes:
- Profiles must have a unique name. If you attempt to create a profile
with a name that already existed in the users namespace the module will
@@ -174,7 +168,7 @@ lxd_profile:
sample: "absent"
logs:
descriptions: The logs of requests and responses.
- returned: when the debug parameter is true and any requests were sent.
+ returned: when ansible-playbook is invoked with -vvvv.
actions:
description: List of actions performed for the profile.
returned: success
@@ -211,7 +205,7 @@ class LXDProfileManagement(object):
self.url = self.module.params['url']
self.key_file = self.module.params.get('key_file', None)
self.cert_file = self.module.params.get('cert_file', None)
- self.debug = self.module.params['debug']
+ self.debug = self.module._verbosity >= 4
try:
self.client = LXDClient(
self.url, key_file=self.key_file, cert_file=self.cert_file,
@@ -371,10 +365,6 @@ def main():
),
trust_password=dict(
type='str',
- ),
- debug=dict(
- type='bool',
- default=False
)
),
supports_check_mode=False,