diff --git a/employ/exceptions.py b/employ/exceptions.py new file mode 100644 index 0000000..e75781b --- /dev/null +++ b/employ/exceptions.py @@ -0,0 +1,16 @@ +class EmployError(Exception): + """ + Base Employ Exception + """ + + +class ExecutionError(EmployError): + """ + Error when executing a command + """ + + +class SSHConnectionError(EmployError): + """ + Could not connect to EC2 Instance with SSH + """ diff --git a/employ/managers/__init__.py b/employ/managers/__init__.py index 5ab412c..44bb50a 100644 --- a/employ/managers/__init__.py +++ b/employ/managers/__init__.py @@ -1,6 +1,8 @@ from pkgutil import extend_path __path__ = extend_path(__path__, __name__) +from employ.execptions import ExecutionError + class Manager(object): name = "manager" diff --git a/employ/managers/ec2.py b/employ/managers/ec2.py index 890488d..68b1b1c 100644 --- a/employ/managers/ec2.py +++ b/employ/managers/ec2.py @@ -3,6 +3,7 @@ import time import boto.ec2 from boto.manage.cmdshell import sshclient_from_instance +from employ.exceptions import SSHConnectionError from employ.managers import Manager