blob: 5df07689caac9cfebcb8c52ee3e5c0ef21de40f1 [file] [log] [blame]
Sapan Bhatiacf06d6f2014-07-22 00:22:58 -04001import os
2import json
3
4class AwsException(Exception):
5 pass
6
7def aws_run(cmd):
8 cmd = 'aws %s'%cmd
9 pipe = os.popen(cmd)
10 output_str = pipe.read()
11
12 if (not pipe.close()):
13 output = json.loads(output_str)
14 return output
15 else:
16 raise AwsException("Error: %s"%output_str)
17
18