Skip to content

Commit

Permalink
A working version on Python 2.6
Browse files Browse the repository at this point in the history
  • Loading branch information
Yen Chi Hsuan committed Nov 13, 2014
1 parent 9398a54 commit 86ae4d1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 3 additions & 1 deletion .gitignore
@@ -1,4 +1,6 @@
*.pyc
# generated in Flask
*.pyo
*~
*.conf
*.bak
*.bak
2 changes: 1 addition & 1 deletion interfaces.py
Expand Up @@ -3,7 +3,7 @@
from interfacesReader import InterfacesReader
from adapter import NetworkAdapter
import toolutils
import defaults
#import defaults


class Interfaces:
Expand Down
5 changes: 3 additions & 2 deletions toolutils.py
Expand Up @@ -9,8 +9,9 @@ def safe_subprocess(command_array):
''' return True/False, command output '''

try:
return True, subprocess.check_output(command_array,
stderr=subprocess.STDOUT)
return True, subprocess.Popen(command_array,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT).communicate()[0]
except OSError as e:
return False, e.__str__()
except subprocess.CalledProcessError as e:
Expand Down

0 comments on commit 86ae4d1

Please sign in to comment.