From 7d5d0625b881361b946ea059916e203bd81a16fa Mon Sep 17 00:00:00 2001 From: spisarski Date: Thu, 20 Jul 2017 11:20:13 -0600 Subject: Created new class KeypairSettingsError. Raising KeypairSettingsError in KeypairSettings instead of Exception. JIRA: SNAPS-133 Change-Id: Ie67f1da429f7d7a5e1c71c4f2f30bf9d11bbe209 Signed-off-by: spisarski --- snaps/openstack/create_keypairs.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'snaps/openstack/create_keypairs.py') diff --git a/snaps/openstack/create_keypairs.py b/snaps/openstack/create_keypairs.py index 83cfbbc..03ff7ec 100644 --- a/snaps/openstack/create_keypairs.py +++ b/snaps/openstack/create_keypairs.py @@ -130,4 +130,10 @@ class KeypairSettings: self.private_filepath = kwargs.get('private_filepath') if not self.name: - raise Exception('Name is a required attribute') + raise KeypairSettingsError('Name is a required attribute') + + +class KeypairSettingsError(Exception): + """ + Exception to be thrown when keypair settings are incorrect + """ -- cgit 1.2.3-korg