提交 e090be9b 编写于 作者: M MRXLT

fix monitor

上级 8e0e8c71
...@@ -20,7 +20,7 @@ Usage: ...@@ -20,7 +20,7 @@ Usage:
import os import os
import time import time
import argparse import argparse
import commands import subprocess
import datetime import datetime
import shutil import shutil
import tarfile import tarfile
...@@ -209,7 +209,7 @@ class HadoopMonitor(Monitor): ...@@ -209,7 +209,7 @@ class HadoopMonitor(Monitor):
remote_filepath = os.path.join(path, filename) remote_filepath = os.path.join(path, filename)
cmd = '{} -ls {} 2>/dev/null'.format(self._cmd_prefix, remote_filepath) cmd = '{} -ls {} 2>/dev/null'.format(self._cmd_prefix, remote_filepath)
_LOGGER.debug('check cmd: {}'.format(cmd)) _LOGGER.debug('check cmd: {}'.format(cmd))
[status, output] = commands.getstatusoutput(cmd) [status, output] = subprocess.getstatusoutput(cmd)
_LOGGER.debug('resp: {}'.format(output)) _LOGGER.debug('resp: {}'.format(output))
if status == 0: if status == 0:
[_, _, _, _, _, mdate, mtime, _] = output.split('\n')[-1].split() [_, _, _, _, _, mdate, mtime, _] = output.split('\n')[-1].split()
......
...@@ -20,7 +20,7 @@ Usage: ...@@ -20,7 +20,7 @@ Usage:
import os import os
import time import time
import argparse import argparse
import commands import subprocess
import datetime import datetime
import shutil import shutil
import tarfile import tarfile
...@@ -209,7 +209,7 @@ class HadoopMonitor(Monitor): ...@@ -209,7 +209,7 @@ class HadoopMonitor(Monitor):
remote_filepath = os.path.join(path, filename) remote_filepath = os.path.join(path, filename)
cmd = '{} -ls {} 2>/dev/null'.format(self._cmd_prefix, remote_filepath) cmd = '{} -ls {} 2>/dev/null'.format(self._cmd_prefix, remote_filepath)
_LOGGER.debug('check cmd: {}'.format(cmd)) _LOGGER.debug('check cmd: {}'.format(cmd))
[status, output] = commands.getstatusoutput(cmd) [status, output] = subprocess.getstatusoutput(cmd)
_LOGGER.debug('resp: {}'.format(output)) _LOGGER.debug('resp: {}'.format(output))
if status == 0: if status == 0:
[_, _, _, _, _, mdate, mtime, _] = output.split('\n')[-1].split() [_, _, _, _, _, mdate, mtime, _] = output.split('\n')[-1].split()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册