# Commands
- async def command(self, *args, krb5_auth=False, **kwargs):
+ async def command(self, *args, krb5_auth=False, return_output=False, **kwargs):
"""
Runs this shell command
"""
+ stdout = []
+
# Authenticate using Kerberos
if krb5_auth:
await self.krb5_auth()
# Strip newline
line = line.rstrip()
- log.info(line)
+ # Log the output
+ log.debug(line)
+
+ # Store the output if requested
+ if return_output:
+ stdout.append(line)
# Wait until the process has finished
await process.wait()
+ if return_output:
+ return "\n".join(stdout)
+
async def krb5_auth(self):
log.debug("Performing Kerberos authentication...")