Raising AnsibleException in ansible_utils.py instead of Exception.
JIRA: SNAPS-130
Change-Id: I72d7ea3779c9644559ae7dc4dbb26edc4da20594
Signed-off-by: spisarski <s.pisarski@cablelabs.com>
:return: the results
"""
if not os.path.isfile(playbook_path):
- raise Exception('Requested playbook not found - ' + playbook_path)
+ raise AnsibleException('Requested playbook not found - ' + playbook_path)
pk_file_path = os.path.expanduser(ssh_priv_key_file_path)
if not os.path.isfile(pk_file_path):
- raise Exception('Requested private SSH key not found - ' +
+ raise AnsibleException('Requested private SSH key not found - ' +
pk_file_path)
import ansible.constants
return ssh
except Exception as e:
logger.warning('Unable to connect via SSH with message - ' + str(e))
+
+
+class AnsibleException(Exception):
+ """
+ Exception when calls to the Keystone client cannot be served properly
+ """