Make journal_dump py3.6 compatable
Currently journal_dump passes `capture_output` argument to subprocess.run which is valid only since py3.7 while we're running systems with default py3.6. We replace capture_output with old proven subprocess.PIPE for compatability with older Python versions. Change-Id: Id7713d8eeec86a910739ac64d3b0815fcfeb506d
This commit is contained in:
@@ -34,7 +34,7 @@ def get_container_journals():
|
|||||||
journals = []
|
journals = []
|
||||||
|
|
||||||
try:
|
try:
|
||||||
s = subprocess.run(['lxc-ls', '-1'], capture_output=True)
|
s = subprocess.run(['lxc-ls', '-1'], stdout=subprocess.PIPE)
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
return journals
|
return journals
|
||||||
|
|
||||||
@@ -44,7 +44,7 @@ def get_container_journals():
|
|||||||
info = {}
|
info = {}
|
||||||
info['name'] = container_name
|
info['name'] = container_name
|
||||||
info['subdir'] = "openstack"
|
info['subdir'] = "openstack"
|
||||||
s = subprocess.run(['lxc-info', '--pid', '--no-humanize', container_name], capture_output=True)
|
s = subprocess.run(['lxc-info', '--pid', '--no-humanize', container_name], stdout=subprocess.PIPE)
|
||||||
info['pid'] = s.stdout.decode('utf-8').strip()
|
info['pid'] = s.stdout.decode('utf-8').strip()
|
||||||
|
|
||||||
if(len(info['pid']) == 0):
|
if(len(info['pid']) == 0):
|
||||||
|
|||||||
Reference in New Issue
Block a user