|
|
@@ -32,6 +32,7 @@ from cloudbridge.cloud.base.services import BaseVolumeService
|
|
|
from cloudbridge.cloud.interfaces.exceptions import DuplicateResourceException
|
|
|
from cloudbridge.cloud.interfaces.exceptions import \
|
|
|
InvalidConfigurationException
|
|
|
+from cloudbridge.cloud.interfaces.exceptions import InvalidParamException
|
|
|
from cloudbridge.cloud.interfaces.resources import KeyPair
|
|
|
from cloudbridge.cloud.interfaces.resources import MachineImage
|
|
|
from cloudbridge.cloud.interfaces.resources import Network
|
|
|
@@ -100,8 +101,9 @@ class AWSKeyPairService(BaseKeyPairService):
|
|
|
|
|
|
# All kwargs should have been popped at this time.
|
|
|
if len(kwargs) > 0:
|
|
|
- raise TypeError("Unrecognised parameters for search: %s."
|
|
|
- " Supported attributes: %s" % (kwargs, 'name'))
|
|
|
+ raise InvalidParamException(
|
|
|
+ "Unrecognised parameters for search: %s. Supported "
|
|
|
+ "attributes: %s" % (kwargs, 'name'))
|
|
|
|
|
|
log.debug("Searching for Key Pair %s", name)
|
|
|
return self.svc.find(filter_name='key-name', filter_value=name)
|
|
|
@@ -160,8 +162,9 @@ class AWSVMFirewallService(BaseVMFirewallService):
|
|
|
log.debug("Searching for Firewall Service %s", label)
|
|
|
# All kwargs should have been popped at this time.
|
|
|
if len(kwargs) > 0:
|
|
|
- raise TypeError("Unrecognised parameters for search: %s."
|
|
|
- " Supported attributes: %s" % (kwargs, 'label'))
|
|
|
+ raise InvalidParamException(
|
|
|
+ "Unrecognised parameters for search: %s. Supported "
|
|
|
+ "attributes: %s" % (kwargs, 'label'))
|
|
|
return self.svc.find(filter_name='tag:Name',
|
|
|
filter_value=label)
|
|
|
|
|
|
@@ -218,8 +221,9 @@ class AWSVolumeService(BaseVolumeService):
|
|
|
|
|
|
# All kwargs should have been popped at this time.
|
|
|
if len(kwargs) > 0:
|
|
|
- raise TypeError("Unrecognised parameters for search: %s."
|
|
|
- " Supported attributes: %s" % (kwargs, 'label'))
|
|
|
+ raise InvalidParamException(
|
|
|
+ "Unrecognised parameters for search: %s. Supported "
|
|
|
+ "attributes: %s" % (kwargs, 'label'))
|
|
|
|
|
|
log.debug("Searching for AWS Volume Service %s", label)
|
|
|
return self.svc.find(filter_name='tag:Name', filter_value=label)
|
|
|
@@ -473,8 +477,9 @@ class AWSImageService(BaseImageService):
|
|
|
|
|
|
# All kwargs should have been popped at this time.
|
|
|
if len(kwargs) > 0:
|
|
|
- raise TypeError("Unrecognised parameters for search: %s."
|
|
|
- " Supported attributes: %s" % (kwargs, 'label'))
|
|
|
+ raise InvalidParamException(
|
|
|
+ "Unrecognised parameters for search: %s. Supported "
|
|
|
+ "attributes: %s" % (kwargs, 'label'))
|
|
|
|
|
|
extra_args = {}
|
|
|
if owner:
|
|
|
@@ -650,8 +655,9 @@ class AWSInstanceService(BaseInstanceService):
|
|
|
|
|
|
# All kwargs should have been popped at this time.
|
|
|
if len(kwargs) > 0:
|
|
|
- raise TypeError("Unrecognised parameters for search: %s."
|
|
|
- " Supported attributes: %s" % (kwargs, 'label'))
|
|
|
+ raise InvalidParamException(
|
|
|
+ "Unrecognised parameters for search: %s. Supported "
|
|
|
+ "attributes: %s" % (kwargs, 'label'))
|
|
|
|
|
|
return self.svc.find(filter_name='tag:Name', filter_value=label)
|
|
|
|
|
|
@@ -763,8 +769,9 @@ class AWSNetworkService(BaseNetworkService):
|
|
|
|
|
|
# All kwargs should have been popped at this time.
|
|
|
if len(kwargs) > 0:
|
|
|
- raise TypeError("Unrecognised parameters for search: %s."
|
|
|
- " Supported attributes: %s" % (kwargs, 'label'))
|
|
|
+ raise InvalidParamException(
|
|
|
+ "Unrecognised parameters for search: %s. Supported "
|
|
|
+ "attributes: %s" % (kwargs, 'label'))
|
|
|
|
|
|
log.debug("Searching for AWS Network Service %s", label)
|
|
|
return self.svc.find(filter_name='tag:Name', filter_value=label)
|
|
|
@@ -827,8 +834,9 @@ class AWSSubnetService(BaseSubnetService):
|
|
|
|
|
|
# All kwargs should have been popped at this time.
|
|
|
if len(kwargs) > 0:
|
|
|
- raise TypeError("Unrecognised parameters for search: %s."
|
|
|
- " Supported attributes: %s" % (kwargs, 'label'))
|
|
|
+ raise InvalidParamException(
|
|
|
+ "Unrecognised parameters for search: %s. Supported "
|
|
|
+ "attributes: %s" % (kwargs, 'label'))
|
|
|
|
|
|
log.debug("Searching for AWS Subnet Service %s", label)
|
|
|
return self.svc.find(filter_name='tag:Name', filter_value=label)
|
|
|
@@ -978,8 +986,9 @@ class AWSRouterService(BaseRouterService):
|
|
|
|
|
|
# All kwargs should have been popped at this time.
|
|
|
if len(kwargs) > 0:
|
|
|
- raise TypeError("Unrecognised parameters for search: %s."
|
|
|
- " Supported attributes: %s" % (kwargs, 'label'))
|
|
|
+ raise InvalidParamException(
|
|
|
+ "Unrecognised parameters for search: %s. Supported "
|
|
|
+ "attributes: %s" % (kwargs, 'label'))
|
|
|
|
|
|
log.debug("Searching for AWS Router Service %s", label)
|
|
|
return self.svc.find(filter_name='tag:Name', filter_value=label)
|