Пример #1
0
    def from_config(cls, prov_config, prov_key, appliance=None):
        appliance = appliance or cls.appliance
        endpoints = {
            RHOSEndpoint.name: RHOSEndpoint(**prov_config['endpoints'][RHOSEndpoint.name])
        }

        event_endpoint_config = prov_config['endpoints'].get(EventsEndpoint.name, {})
        if event_endpoint_config:
            endpoints[EventsEndpoint.name] = EventsEndpoint(**event_endpoint_config)

        rsa_endpoint_config = prov_config['endpoints'].get(SSHEndpoint.name, {})
        if rsa_endpoint_config:
            endpoints[SSHEndpoint.name] = SSHEndpoint(**rsa_endpoint_config)

        from cfme.utils.providers import get_crud
        infra_prov_key = prov_config.get('infra_provider_key')
        infra_provider = get_crud(infra_prov_key) if infra_prov_key else None

        return appliance.collections.cloud_providers.instantiate(
            prov_class=cls,
            name=prov_config['name'],
            api_port=prov_config['port'],
            api_version=prov_config.get('api_version', 'Keystone v2'),
            endpoints=endpoints,
            zone=prov_config['server_zone'],
            key=prov_key,
            keystone_v3_domain_id=prov_config.get('domain_id'),
            sec_protocol=prov_config.get('sec_protocol', "Non-SSL"),
            tenant_mapping=prov_config.get('tenant_mapping', False),
            infra_provider=infra_provider)
Пример #2
0
    def from_config(cls, prov_config, prov_key):
        endpoints = {}
        endpoints[RHOSEndpoint.name] = RHOSEndpoint(
            **prov_config['endpoints'][RHOSEndpoint.name])

        endp_name = EventsEndpoint.name
        if prov_config['endpoints'].get(endp_name):
            endpoints[endp_name] = EventsEndpoint(
                **prov_config['endpoints'][endp_name])

        from cfme.utils.providers import get_crud
        infra_prov_key = prov_config.get('infra_provider_key')
        infra_provider = get_crud(infra_prov_key) if infra_prov_key else None

        return cls.appliance.collections.cloud_providers.instantiate(
            prov_class=cls,
            name=prov_config['name'],
            api_port=prov_config['port'],
            api_version=prov_config.get('api_version', 'Keystone v2'),
            endpoints=endpoints,
            zone=prov_config['server_zone'],
            key=prov_key,
            keystone_v3_domain_id=prov_config.get('domain_id'),
            sec_protocol=prov_config.get('sec_protocol', "Non-SSL"),
            tenant_mapping=prov_config.get('tenant_mapping', False),
            infra_provider=infra_provider)
Пример #3
0
    def from_config(cls, prov_config, prov_key, appliance=None):
        endpoints = {}
        endpoints[RHOSEndpoint.name] = RHOSEndpoint(**prov_config['endpoints'][RHOSEndpoint.name])

        endp_name = EventsEndpoint.name
        if prov_config['endpoints'].get(endp_name):
            endpoints[endp_name] = EventsEndpoint(**prov_config['endpoints'][endp_name])

        from cfme.utils.providers import get_crud
        infra_prov_key = prov_config.get('infra_provider_key')
        infra_provider = get_crud(infra_prov_key, appliance=appliance) if infra_prov_key else None
        api_version = prov_config.get('api_version', None)

        if not api_version:
            api_version = 'Keystone v2'

        return cls(name=prov_config['name'],
                   hostname=prov_config['hostname'],
                   ip_address=prov_config['ipaddress'],
                   api_port=prov_config['port'],
                   api_version=api_version,
                   endpoints=endpoints,
                   zone=prov_config['server_zone'],
                   key=prov_key,
                   keystone_v3_domain_id=prov_config.get('domain_id', None),
                   sec_protocol=prov_config.get('sec_protocol', "Non-SSL"),
                   tenant_mapping=prov_config.get('tenant_mapping', False),
                   infra_provider=infra_provider,
                   appliance=appliance)
Пример #4
0
    def from_config(cls, prov_config, prov_key):
        endpoints = {
            RHOSEndpoint.name:
            RHOSEndpoint(**prov_config['endpoints'][RHOSEndpoint.name])
        }

        event_endpoint_config = prov_config['endpoints'].get(
            EventsEndpoint.name, {})
        if event_endpoint_config:
            if (event_endpoint_config.get('event_stream') == 'AMQP'
                    and BZ(1618700, forced_streams=["5.9", "5.10", "upstream"
                                                    ]).blocks):
                logger.warning('Skipping AMQP event config due to BZ 1618700')
            else:
                endpoints[EventsEndpoint.name] = EventsEndpoint(
                    **event_endpoint_config)

        from cfme.utils.providers import get_crud
        infra_prov_key = prov_config.get('infra_provider_key')
        infra_provider = get_crud(infra_prov_key) if infra_prov_key else None

        return cls.appliance.collections.cloud_providers.instantiate(
            prov_class=cls,
            name=prov_config['name'],
            api_port=prov_config['port'],
            api_version=prov_config.get('api_version', 'Keystone v2'),
            endpoints=endpoints,
            zone=prov_config['server_zone'],
            key=prov_key,
            keystone_v3_domain_id=prov_config.get('domain_id'),
            sec_protocol=prov_config.get('sec_protocol', "Non-SSL"),
            tenant_mapping=prov_config.get('tenant_mapping', False),
            infra_provider=infra_provider)