Source code for elasticluster.exceptions

#! /usr/bin/env python
#   Copyright (C) 2013-2018 University of Zurich
#   This program is free software: you can redistribute it and/or modify
#   it under the terms of the GNU General Public License as published by
#   the Free Software Foundation, either version 3 of the License, or
#   (at your option) any later version.
#   This program is distributed in the hope that it will be useful,
#   but WITHOUT ANY WARRANTY; without even the implied warranty of
#   GNU General Public License for more details.
#   You should have received a copy of the GNU General Public License
#   along with this program.  If not, see <>.
__author__ = '''
    Nicolas Baer <>,
    Riccardo Murri <>

[docs]class ConfigurationError(Exception): pass
[docs]class CredentialsError(Exception): pass
[docs]class UnsupportedError(ConfigurationError): pass
[docs]class VpcError(Exception): pass
[docs]class SecurityGroupError(Exception): pass
[docs]class SubnetError(Exception): pass
[docs]class KeypairError(Exception): pass
[docs]class InstanceError(Exception): """ Generic error dealing with cloud-based VM. The difference between this and other errors raised by cloud APIs (e.g., `FlavorError`:class:) is that `InstanceError` occurs when operations fail on a VM instance that ElastiCluster assumes *existing* (whereas, e.g., `FlavorError`:class: might happen when starting a VM instance fails). """ pass
[docs]class InstanceNotFoundError(InstanceError): """ The cloud provider does not know about the given VM instance. """ pass
[docs]class FlavorError(Exception): pass
[docs]class TimeoutError(Exception): pass
[docs]class ClusterNotFound(LookupError): pass
[docs]class ClusterError(Exception): pass
[docs]class ClusterSizeError(ClusterError): """ Not enough nodes (of one or more kinds) are available. """ def __init__(self, msg=None): super(ClusterSizeError, self).__init__(msg or "The cluster does not provide the minimum" " amount of nodes specified in the" " configuration. Some nodes are running," " but the cluster will not be set up yet." " Please change the minimum amount of nodes in the" " configuration or try to start a new cluster" " after checking the cloud provider settings.")
[docs]class NodeNotFound(LookupError): pass
[docs]class ImageError(Exception): pass
[docs]class CloudProviderError(Exception): pass
[docs]class SetupProviderError(Exception): """ Generic error happening during the setup phase. """ pass