Simplify use of split call for port management
Recent changes to introduce port management via juju are not directly compatible with Python3, due to use of bytes vs str. .split() actually just does the right thing anyway, so simplify the call to opened-ports so that it works with any Python version. Change-Id: I132a1889bf657c66bf11e65c8a05934dc67c58bd Closes-Bug: 1650340
This commit is contained in:
parent
a996530d41
commit
4e9b83d7b3
|
@ -728,7 +728,7 @@ class OpenStackCharm(object):
|
|||
protocol = protocol.lower()
|
||||
else:
|
||||
protocol = ''
|
||||
lines = [l for l in subprocess.check_output(_args).split('\n') if l]
|
||||
lines = [l for l in subprocess.check_output(_args).split() if l]
|
||||
ports = []
|
||||
for line in lines:
|
||||
p, p_type = line.split('/')
|
||||
|
|
Loading…
Reference in New Issue