Eliminate os.system call.

This commit is contained in:
Oleksii Kliukin
2015-09-28 12:04:06 +02:00
parent d44a54628a
commit e39d318732
+4 -1
View File
@@ -77,7 +77,10 @@ class Postgresql:
self._pg_rewind_present = ('username' in self._pg_rewind and
('wal_log_hints' in self.config['parameters'] or
'data_checksums' in self.config['parameters']) and
os.system("pg_rewind --version >/dev/null 2>&1") == 0)
subprocess.call(['pg_rewind',
'--version'],
stdout=open(os.devnull, 'w'),
stderr=subprocess.STDOUT) == 0)
if self._pg_rewind_present:
self._pg_rewind['user'] = self._pg_rewind['username']
except: