CloudVE / CloudVE/cloudbridge

Invalid connection settings not throwing reasonable exceptions

Open
#196 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
117
Forks
51
Avg merge
9h 17m
Merged PRs (30d)
5

Description

Having invalid connection settings such as a None value for subscription_id in Azure, does not throw a reasonable exception.

E.g. the error thrown is as follows
```
File "/Users/Nuwan/work/djcloudbridge/djcloudbridge/domain_model.py", line 50, in get_cloud_provider
config)
File "/Users/Nuwan/work/djcloudbridge/venv/lib/python3.6/site-packages/cloudbridge/cloud/factory.py", line 142, in create_provider
return provider_class(config)
File "/Users/Nuwan/work/djcloudbridge/venv/lib/python3.6/site-packages/cloudbridge/cloud/providers/azure/provider.py", line 52, in __init__
'storacc' + self.subscription_id[-6:] +
TypeError: 'NoneType' object is not subscriptable
```

The ideal behaviour is to accept an empty Config without errors, because sometimes, the config settings may come from a boto config for example. but for provider.authenticate() and any connection related methods to throw an appropriate error, like InvalidProviderSetting or similar. If the setting is definitely invalid, then we can throw an InvalidProviderSetting even earlier, during provider instantiation itself.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.