|
@@ -27,14 +27,13 @@ class PushCommandView(View):
|
|
|
return self.PushCommand(request_dict)
|
|
|
|
|
|
def PushCommand(self, request_dict):
|
|
|
- response = ResponseObject()
|
|
|
command = request_dict.get('command', None)
|
|
|
if not command:
|
|
|
- return response(444)
|
|
|
+ return repr(444)
|
|
|
try:
|
|
|
back = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE). \
|
|
|
communicate(timeout=2)
|
|
|
- return response.json(0, back)
|
|
|
+ return repr(back)
|
|
|
except Exception as e:
|
|
|
- return response(500, repr(e))
|
|
|
+ return repr(e)
|
|
|
|