Skip to content
Snippets Groups Projects
Commit 8b38b984 authored by Marcus Github Hardt's avatar Marcus Github Hardt
Browse files

Merge branch 'fix-capture-output' into 'master'

Fix capture_output not found error

See merge request feudal/feudalAdapterLdf!79
parents 652c71b4 94cb55e3
No related branches found
No related tags found
1 merge request!79Fix capture_output not found error
......@@ -63,7 +63,7 @@ class User:
options = ['-l']
try:
result = subprocess.run(['chage'] + options + [self.name],
capture_output=True, check=True)
stdout=subprocess.PIPE, check=True)
except CalledProcessError as e:
msg = (e.stderr or e.stdout or b'').decode('utf-8').strip()
logger.error('Error executing \'{}\': {}'.format(' '.join(e.cmd), msg or "<no output>"))
......@@ -177,8 +177,7 @@ class User:
def __expire(self, expiration_date=datetime.today().strftime("%Y-%m-%d")):
options = ['-E', expiration_date]
try:
subprocess.run(['chage'] + options + [self.name],
capture_output=True, check=True)
subprocess.run(['chage'] + options + [self.name], check=True)
except CalledProcessError as e:
msg = (e.stderr or e.stdout or b'').decode('utf-8').strip()
logger.error('Error executing \'{}\': {}'.format(' '.join(e.cmd), msg or "<no output>"))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment