Skip to content
This repository has been archived by the owner on Jun 13, 2024. It is now read-only.

Commit

Permalink
Also provide log_lines
Browse files Browse the repository at this point in the history
  • Loading branch information
fabianvf committed Feb 6, 2020
1 parent 51b63dc commit 92a8752
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions plugins/modules/k8s_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@
description:
- The text log of the object
returned: success
log_lines:
type: list
description:
- The log of the object, split on newlines
returned: success
'''


Expand Down Expand Up @@ -173,11 +178,13 @@ def execute_module(self):
if self.params.get('container'):
kwargs['query_params'] = dict(container=self.params['container'])

self.exit_json(changed=False, log=resource.log.get(
log = resource.log.get(
name=name,
namespace=self.params.get('namespace'),
**kwargs
))
)

self.exit_json(changed=False, log=log, log_lines=log.split('\n'))

def extract_selectors(self, instance):
# Parses selectors on an object based on the specifications documented here:
Expand Down

0 comments on commit 92a8752

Please sign in to comment.