35
35
import six
36
36
37
37
from coriolisclient import client
38
+ from coriolisclient import exceptions
38
39
from coriolisclient import version
39
40
40
41
@@ -100,7 +101,7 @@ def check_auth_arguments(self, args, api_version=None, raise_exc=False):
100
101
successful = False
101
102
102
103
if not successful and raise_exc :
103
- raise Exception (msg )
104
+ raise exceptions . CoriolisException (msg )
104
105
105
106
return successful
106
107
@@ -157,15 +158,15 @@ def create_client(self, args):
157
158
api_version = args .os_identity_api_version
158
159
verify = args .os_cacert or not args .insecure
159
160
if args .no_auth and args .os_auth_url :
160
- raise Exception (
161
+ raise exceptions . CoriolisException (
161
162
'ERROR: argument --os-auth-url/-A: not allowed '
162
163
'with argument --no-auth/-N'
163
164
)
164
165
165
166
if args .no_auth :
166
167
if not all ([args .endpoint , args .os_tenant_id or
167
168
args .os_project_id ]):
168
- raise Exception (
169
+ raise exceptions . CoriolisException (
169
170
'ERROR: please specify --endpoint and '
170
171
'--os-project-id (or --os-tenant-id)' )
171
172
created_client = client .Client (
@@ -177,7 +178,8 @@ def create_client(self, args):
177
178
# Token-based authentication
178
179
elif args .os_auth_token :
179
180
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' )
181
183
token_kwargs = {
182
184
'auth_url' : args .os_auth_url ,
183
185
'token' : args .os_auth_token
@@ -210,7 +212,8 @@ def create_client(self, args):
210
212
** endpoint_filter_kwargs
211
213
)
212
214
else :
213
- raise Exception ('ERROR: please specify authentication credentials' )
215
+ raise exceptions .CoriolisException (
216
+ 'ERROR: please specify authentication credentials' )
214
217
215
218
return created_client
216
219
0 commit comments