diff options
Diffstat (limited to 'snaps/openstack')
-rw-r--r-- | snaps/openstack/create_instance.py | 7 | ||||
-rw-r--r-- | snaps/openstack/utils/launch_utils.py | 16 |
2 files changed, 12 insertions, 11 deletions
diff --git a/snaps/openstack/create_instance.py b/snaps/openstack/create_instance.py index 16bd0ce..b158a25 100644 --- a/snaps/openstack/create_instance.py +++ b/snaps/openstack/create_instance.py @@ -474,9 +474,12 @@ class OpenStackVmInstance(OpenStackComputeObject): playbook :param fip_name: the name of the floating IP to use for applying the playbook (default - will take the first) - :return: the return value from ansible """ - return ansible_utils.apply_playbook( + from warnings import warn + warn('This method will be removed in a subsequent release', + DeprecationWarning) + + ansible_utils.apply_playbook( pb_file_loc, [self.get_floating_ip(fip_name=fip_name).ip], self.get_image_user(), ssh_priv_key_file_path=self.keypair_settings.private_filepath, diff --git a/snaps/openstack/utils/launch_utils.py b/snaps/openstack/utils/launch_utils.py index 00ea822..ddaad12 100644 --- a/snaps/openstack/utils/launch_utils.py +++ b/snaps/openstack/utils/launch_utils.py @@ -53,6 +53,10 @@ from snaps.openstack.utils import deploy_utils, neutron_utils, keystone_utils from snaps.openstack.utils.nova_utils import RebootType from snaps.provisioning import ansible_utils +from warnings import warn +warn('This utility will be removed in a subsequent release', + DeprecationWarning) + logger = logging.getLogger('lanuch_utils') DEFAULT_CREDS_KEY = 'admin' @@ -464,17 +468,13 @@ def __apply_ansible_playbook(ansible_config, os_creds_dict, vm_dict, ansible_config.get('variables'), os_creds_dict, vm_dict, image_dict, flavor_dict, networks_dict, routers_dict) - retval = ansible_utils.apply_playbook( + ansible_utils.apply_playbook( ansible_config['playbook_location'], floating_ips, remote_user, ssh_priv_key_file_path=private_key_filepath, variables=variables, proxy_setting=proxy_settings) - if retval != 0: - # Not a fatal type of event - raise Exception( - 'Error applying playbook found at location - %s', - ansible_config.get('playbook_location')) - elif ansible_config.get('post_processing'): + + if 'post_processing' in ansible_config: post_proc_config = ansible_config['post_processing'] if 'sleep' in post_proc_config: time.sleep(post_proc_config['sleep']) @@ -484,8 +484,6 @@ def __apply_ansible_playbook(ansible_config, os_creds_dict, vm_dict, logger.info('Rebooting VM - %s', vm_name) vm_dict[vm_name].reboot(RebootType.hard) - return retval - def __get_connection_info(ansible_config, vm_dict): """ |