Пример #1
0
 def _to_settings(self, config, password):
     settings = E_VMEXT.AmqpSettings()
     settings.append(E_VMEXT.AmqpHost(config['AmqpHost']))
     settings.append(E_VMEXT.AmqpPort(config['AmqpPort']))
     settings.append(E_VMEXT.AmqpUsername(config['AmqpUsername']))
     settings.append(E_VMEXT.AmqpPassword(password))
     settings.append(E_VMEXT.AmqpExchange(config['AmqpExchange']))
     settings.append(E_VMEXT.AmqpVHost(config['AmqpVHost']))
     settings.append(E_VMEXT.AmqpUseSSL(config['AmqpUseSSL']))
     settings.append(E_VMEXT.AmqpSslAcceptAll(config['AmqpSslAcceptAll']))
     settings.append(E_VMEXT.AmqpPrefix(config['AmqpPrefix']))
     return settings
Пример #2
0
    def _to_settings(self, config, password):
        """Converts dictionary representation of configuration to XML element.

        :param dict config: dictionary representation of AMQP service
            configuration.
        :param str password: password of the user for the AMQP service.

        :return: an object containing EntityType.AMQP_SETTINGS XML data
            representing the configuration of the AMQP service.

        :rtype: lxml.objectify.ObjectifiedElement
        """
        settings = E_VMEXT.AmqpSettings()
        settings.append(E_VMEXT.AmqpHost(config['AmqpHost']))
        settings.append(E_VMEXT.AmqpPort(config['AmqpPort']))
        settings.append(E_VMEXT.AmqpUsername(config['AmqpUsername']))
        settings.append(E_VMEXT.AmqpPassword(password))
        settings.append(E_VMEXT.AmqpExchange(config['AmqpExchange']))
        settings.append(E_VMEXT.AmqpVHost(config['AmqpVHost']))
        settings.append(E_VMEXT.AmqpUseSSL(config['AmqpUseSSL']))
        settings.append(E_VMEXT.AmqpSslAcceptAll(config['AmqpSslAcceptAll']))
        settings.append(E_VMEXT.AmqpPrefix(config['AmqpPrefix']))
        return settings