Skip to content

Commit 08a411f

Browse files
committed
Change generic Exception to CoriolisException in coriolisclient.cli.shell.py
1 parent c2ab5b2 commit 08a411f

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

coriolisclient/cli/shell.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
import six
3636

3737
from coriolisclient import client
38+
from coriolisclient import exceptions
3839
from coriolisclient import version
3940

4041

@@ -100,7 +101,7 @@ def check_auth_arguments(self, args, api_version=None, raise_exc=False):
100101
successful = False
101102

102103
if not successful and raise_exc:
103-
raise Exception(msg)
104+
raise exceptions.CoriolisException(msg)
104105

105106
return successful
106107

@@ -157,15 +158,15 @@ def create_client(self, args):
157158
api_version = args.os_identity_api_version
158159
verify = args.os_cacert or not args.insecure
159160
if args.no_auth and args.os_auth_url:
160-
raise Exception(
161+
raise exceptions.CoriolisException(
161162
'ERROR: argument --os-auth-url/-A: not allowed '
162163
'with argument --no-auth/-N'
163164
)
164165

165166
if args.no_auth:
166167
if not all([args.endpoint, args.os_tenant_id or
167168
args.os_project_id]):
168-
raise Exception(
169+
raise exceptions.CoriolisException(
169170
'ERROR: please specify --endpoint and '
170171
'--os-project-id (or --os-tenant-id)')
171172
created_client = client.Client(
@@ -177,7 +178,8 @@ def create_client(self, args):
177178
# Token-based authentication
178179
elif args.os_auth_token:
179180
if not args.os_auth_url:
180-
raise Exception('ERROR: please specify --os-auth-url')
181+
raise exceptions.CoriolisException(
182+
'ERROR: please specify --os-auth-url')
181183
token_kwargs = {
182184
'auth_url': args.os_auth_url,
183185
'token': args.os_auth_token
@@ -210,7 +212,8 @@ def create_client(self, args):
210212
**endpoint_filter_kwargs
211213
)
212214
else:
213-
raise Exception('ERROR: please specify authentication credentials')
215+
raise exceptions.CoriolisException(
216+
'ERROR: please specify authentication credentials')
214217

215218
return created_client
216219

0 commit comments

Comments
 (0)