+
+def get_deployment_handler():
+ global handler
+ global pod_arch
+
+ installer_params_yaml = os.path.join(
+ CONST.__getattribute__('dir_repo_functest'),
+ 'functest/ci/installer_params.yaml')
+ if (CONST.__getattribute__('INSTALLER_IP') and
+ CONST.__getattribute__('INSTALLER_TYPE') and
+ CONST.__getattribute__('INSTALLER_TYPE') in
+ opnfv_constants.INSTALLERS):
+ try:
+ installer_params = ft_utils.get_parameter_from_yaml(
+ CONST.__getattribute__('INSTALLER_TYPE'),
+ installer_params_yaml)
+ except ValueError as e:
+ logger.debug('Printing deployment info is not supported for %s' %
+ CONST.__getattribute__('INSTALLER_TYPE'))
+ logger.debug(e)
+ else:
+ user = installer_params.get('user', None)
+ password = installer_params.get('password', None)
+ pkey = installer_params.get('pkey', None)
+ try:
+ handler = factory.Factory.get_handler(
+ installer=CONST.__getattribute__('INSTALLER_TYPE'),
+ installer_ip=CONST.__getattribute__('INSTALLER_IP'),
+ installer_user=user,
+ installer_pwd=password,
+ pkey_file=pkey)
+ if handler:
+ pod_arch = handler.get_arch()
+ except Exception as e:
+ logger.debug("Cannot get deployment information. %s" % e)