| | | magnum_utils.create_cluster_template() will raise a |
| | | BadRequest exception when the image does not exist |
+---------------------------------------+---------------+-----------------------------------------------------------+
-| test_create_cluster_template_bad_kp | 1 | Ensures the function |
-| | | magnum_utils.create_cluster_template() will raise a |
-| | | NotFound exception when the keypair does not exist |
-+---------------------------------------+---------------+-----------------------------------------------------------+
| test_create_cluster_template_bad_ext | 1 | Ensures the function |
| _net | | magnum_utils.create_cluster_template() will raise a |
| | | BadRequest exception when the external network does not |
| | | raise an exception when the image is invalid |
+----------------------------------------+---------------+-----------------------------------------------------------+
| test_create_cluster_template_bad | 1 | Tests to ensure OpenStackClusterTemplate#create() will |
-| _keypair | | raise an exception when the keypair is invalid |
-+----------------------------------------+---------------+-----------------------------------------------------------+
-| test_create_cluster_template_bad | 1 | Tests to ensure OpenStackClusterTemplate#create() will |
| _network_driver | | raise an exception when the network driver is invalid |
+----------------------------------------+---------------+-----------------------------------------------------------+
| test_create_cluster_template_bad | 1 | Tests to ensure OpenStackClusterTemplate#create() will |
return None
:param server_type: the server_type value to map
:return: the ServerType enum object
- :raise: ClusterTypeConfigError if value is invalid
+ :raise: ClusterTemplateConfigError if value is invalid
"""
if not server_type:
return None
When None return None
:param coe: the COE value to map
:return: the ContainerOrchestrationEngine enum object
- :raise: ClusterTypeConfigError if value is invalid
+ :raise: ClusterTemplateConfigError if value is invalid
"""
if not coe:
return None
When None return None
:param driver: the docker storage driver value to map
:return: the DockerStorageDriver enum object
- :raise: ClusterTypeConfigError if value is invalid
+ :raise: ClusterTemplateConfigError if value is invalid
"""
if not driver:
return None
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-from magnumclient.common.apiclient.exceptions import BadRequest, NotFound
+from magnumclient.common.apiclient.exceptions import BadRequest
from snaps.config.cluster_template import ClusterTemplateConfig
from snaps.config.flavor import FlavorConfig
with self.assertRaises(BadRequest):
self.cluster_template_creator.create()
- def test_create_cluster_template_bad_keypair(self):
- """
- Tests the creation of an OpenStack cluster template raises an
- exception with an invalid keypair.
- """
- # Create ClusterTemplate
- cluster_template_config = ClusterTemplateConfig(
- name=self.cluster_type_name,
- image=self.image_creator.image_settings.name,
- keypair='foo',
- external_net=self.ext_net_name,
- flavor=self.flavor_creator.flavor_settings.name)
-
- self.cluster_template_creator = OpenStackClusterTemplate(
- self.os_creds, cluster_template_config)
-
- with self.assertRaises(NotFound):
- self.cluster_template_creator.create()
-
def test_create_cluster_template_bad_network_driver(self):
"""
Tests the creation of an OpenStack cluster template raises an
import logging
import uuid
-from magnumclient.common.apiclient.exceptions import BadRequest, NotFound
+from magnumclient.common.apiclient.exceptions import BadRequest
from snaps.config.cluster_template import (
ClusterTemplateConfig, ServerType, ContainerOrchestrationEngine,
self.cluster_template = magnum_utils.create_cluster_template(
self.magnum, config)
- def test_create_cluster_template_bad_kp(self):
- config = ClusterTemplateConfig(
- name=self.cluster_type_name,
- image=self.image_creator.image_settings.name,
- keypair='foo',
- external_net=self.ext_net_name,
- flavor=self.flavor_creator.flavor_settings.name)
-
- with self.assertRaises(NotFound):
- self.cluster_template = magnum_utils.create_cluster_template(
- self.magnum, config)
-
def test_create_cluster_template_bad_ext_net(self):
config = ClusterTemplateConfig(
name=self.cluster_type_name,