Browse Source

now uses subprocess.Popen for darwin if subprocess.check_output fails

pull/3/head
rscmbbng 11 years ago
parent
commit
2c2a2bb7a6
  1. 7
      main.py
  2. BIN
      web/images/markers/.DS_Store

7
main.py

@ -272,13 +272,18 @@ class bc(object):
""" """
#try: #try:
if self.operating_system == 'darwin': if self.operating_system == 'darwin':
try:
self.content = subprocess.check_output(['lft', self.method, '-n', '-S', self.destination_ip]) self.content = subprocess.check_output(['lft', self.method, '-n', '-S', self.destination_ip])
except:
a = subprocess.Popen(['lft', self.method, '-S', '-n', self.destination_ip], stdout=subprocess.PIPE)
self.content = a.stdout.read()
if self.operating_system == 'linux': if self.operating_system == 'linux':
if self.method == '-e': if self.method == '-e':
self.method = '-E' self.method = '-E'
try: try:
self.content = subprocess.check_output(['lft', '-S', '-n', self.destination_ip]) self.content = subprocess.check_output(['lft', '-S', '-n', self.destination_ip])
# support for older python versions (<2.7) that don't support subprocess.check_output # support for older python versions (<2.75) that don't support subprocess.check_output
except: except:
a = subprocess.Popen(['lft', '-S', '-n', self.destination_ip], stdout=subprocess.PIPE) a = subprocess.Popen(['lft', '-S', '-n', self.destination_ip], stdout=subprocess.PIPE)
self.content = a.stdout.read() self.content = a.stdout.read()

BIN
web/images/markers/.DS_Store

Binary file not shown.
Loading…
Cancel
Save