示例#1
0
文件: model.py 项目: ogelbukh/rubick
    def config(self):
        schema = ConfigSchemaRegistry.get_schema(self.component, self.version)
        if not schema:
            self.logger.debug(
                'No schema for component "%s" main config version %s. '
                'Using untyped parameters (everything is string)' %
                (self.component, self.version))

        return self._parse_config_resources(self.config_files, schema)
示例#2
0
    def config(self):
        schema = ConfigSchemaRegistry.get_schema(self.component, self.version)
        if not schema:
            self.logger.debug(
                'No schema for component "%s" main config version %s. '
                'Using untyped parameters (everything is string)' %
                (self.component, self.version))

        return self._parse_config_resources(self.config_files, schema)
示例#3
0
文件: model.py 项目: ogelbukh/rubick
    def config(self):
        config = Configuration()
        schema = ConfigSchemaRegistry.get_schema('rabbitmq', Version(1000000))
        if schema:
            for parameter in schema.parameters:
                if not parameter.default:
                    continue

                config.set_default(parameter.name, parameter.default)
        else:
            print("RabbitMQ schema not found")

        return config
示例#4
0
    def config(self):
        config = Configuration()
        schema = ConfigSchemaRegistry.get_schema('rabbitmq', Version(1000000))
        if schema:
            for parameter in schema.parameters:
                if not parameter.default:
                    continue

                config.set_default(parameter.name, parameter.default)
        else:
            print("RabbitMQ schema not found")

        return config
示例#5
0
    def test_sample(self):
        nova = ConfigSchemaRegistry.register_schema(project='nova')

        with nova.version('1.0.0', checkpoint=True) as cfg:
            cfg.param(name='verbose', type='boolean')
            cfg.param(name='rabbit_host', type='address')

        with nova.version('1.1.0') as cfg:
            cfg.param(name='verbose', type='boolean', default=False)
            cfg.remove_param('rabbit_host')

        schema10 = ConfigSchemaRegistry.get_schema(project='nova',
                                                   version='1.0.0')

        self.assertEqual(Version('1.0.0'), schema10.version)
        self.assertEqual('ini', schema10.format)

        def find_param(params, name):
            return find(params, lambda p: p.name == name)

        verbose_param = find_param(schema10.parameters, 'verbose')
        self.assertIsNotNone(verbose_param)
        self.assertEqual('boolean', verbose_param.type)
        self.assertEqual(None, verbose_param.default)

        rabbit_host_param = find_param(schema10.parameters, 'rabbit_host')
        self.assertIsNotNone(rabbit_host_param)
        self.assertEqual('address', rabbit_host_param.type)

        schema11 = ConfigSchemaRegistry.get_schema(project='nova',
                                                   version='1.1.0')

        verbose_param11 = find_param(schema11.parameters, 'verbose')
        self.assertIsNotNone(verbose_param11)
        self.assertEqual(False, verbose_param11.default)

        rabbit_host_param11 = find_param(schema11.parameters, 'rabbit_host')
        self.assertIsNone(rabbit_host_param11)
    def test_sample(self):
        nova = ConfigSchemaRegistry.register_schema(project='nova')

        with nova.version('1.0.0', checkpoint=True) as cfg:
            cfg.param(name='verbose', type='boolean')
            cfg.param(name='rabbit_host', type='address')

        with nova.version('1.1.0') as cfg:
            cfg.param(name='verbose', type='boolean', default=False)
            cfg.remove_param('rabbit_host')

        schema10 = ConfigSchemaRegistry.get_schema(project='nova',
                                                   version='1.0.0')

        self.assertEqual(Version('1.0.0'), schema10.version)
        self.assertEqual('ini', schema10.format)

        def find_param(params, name):
            return find(params, lambda p: p.name == name)

        verbose_param = find_param(schema10.parameters, 'verbose')
        self.assertIsNotNone(verbose_param)
        self.assertEqual('boolean', verbose_param.type)
        self.assertEqual(None, verbose_param.default)

        rabbit_host_param = find_param(schema10.parameters, 'rabbit_host')
        self.assertIsNotNone(rabbit_host_param)
        self.assertEqual('address', rabbit_host_param.type)

        schema11 = ConfigSchemaRegistry.get_schema(project='nova',
                                                   version='1.1.0')

        verbose_param11 = find_param(schema11.parameters, 'verbose')
        self.assertIsNotNone(verbose_param11)
        self.assertEqual(False, verbose_param11.default)

        rabbit_host_param11 = find_param(schema11.parameters, 'rabbit_host')
        self.assertIsNone(rabbit_host_param11)
示例#7
0
from rubick.schema import ConfigSchemaRegistry

neutron_server = ConfigSchemaRegistry.register_schema(
    project='neutron_server')

with neutron_server.version('2013.2.1') as neutron_server_2013_2_1:

    neutron_server_2013_2_1.section('DEFAULT')

    neutron_server_2013_2_1.param('verbose', type='string', default='False',
                                     description="Default log level is INFO verbose and debug has the same result. One of them will set DEBUG log level output")

    neutron_server_2013_2_1.param(
        'state_path', type='string', default='/var/lib/neutron',
        description="Where to store Neutron state files.  This directory must be writable by the user executing the agent.")

    neutron_server_2013_2_1.param(
        'lock_path', type='string', default='$state_path/lock', description="Where to store lock files")

    neutron_server_2013_2_1.param(
        'log_format', type='string', default='%(asctime)s %(levelname)8s [%(name)s] %(message)s')

    neutron_server_2013_2_1.param(
        'log_date_format', type='string', default='%Y-%m-%d %H:%M:%S')

    neutron_server_2013_2_1.param(
        'use_syslog', type='string', default='False')

    neutron_server_2013_2_1.param(
        'syslog_log_facility', type='string', default='LOG_USER')
示例#8
0
from rubick.schema import ConfigSchemaRegistry

neutron_l3_agent = ConfigSchemaRegistry.register_schema(
    project='neutron_l3_agent')

with neutron_l3_agent.version('2013.2.1') as neutron_l3_agent_2013_2_1:

    neutron_l3_agent_2013_2_1.section('DEFAULT')

    neutron_l3_agent_2013_2_1.param('debug', type='string', default='False',
                                    description="Show debugging output in log (sets DEBUG log level output)")

    neutron_l3_agent_2013_2_1.param(
        'interface_driver', type='string', default='',
        description="L3 requires that an interface driver be set. Choose the one that best matches your plugin.")

    neutron_l3_agent_2013_2_1.param(
        'interface_driver', type='string', default='neutron.agent.linux.interface.OVSInterfaceDriver',
        description="Example of interface_driver option for OVS based plugins (OVS, Ryu, NEC) that supports L3 agent")

    neutron_l3_agent_2013_2_1.param(
        'ovs_use_veth', type='string', default='False',
        description="Use veth for an OVS interface or not. Support kernels with limited namespace support (e.g. RHEL 6.5) so long as ovs_use_veth is set to True.")

    neutron_l3_agent_2013_2_1.param(
        'interface_driver', type='string', default='neutron.agent.linux.interface.BridgeInterfaceDriver', description="Example of interface_driver option for LinuxBridge")

    neutron_l3_agent_2013_2_1.param(
        'use_namespaces', type='string', default='True',
        description="Allow overlapping IP (Must have kernel build with CONFIG_NET_NS=y and iproute2 package that supports namespaces).")
示例#9
0
from rubick.schema import ConfigSchemaRegistry

swift = ConfigSchemaRegistry.register_schema(project='swift')

with swift.version('2013.2') as swift_2013_2:

    swift_2013_2.section('swift-hash')

    swift_2013_2.param('swift_hash_path_suffix',
                       type='string',
                       default='changeme',
                       description="")

    swift_2013_2.param('swift_hash_path_prefix',
                       type='string',
                       default='changeme',
                       description="")

    swift_2013_2.section('swift-constraints')

    swift_2013_2.param('max_file_size',
                       type='string',
                       default='5368709122',
                       description="")

    swift_2013_2.param('max_meta_name_length',
                       type='string',
                       default='128',
                       description="")

    swift_2013_2.param('max_meta_value_length',
示例#10
0
from rubick.schema import ConfigSchemaRegistry

neutron_openvswitch_agent = ConfigSchemaRegistry.register_schema(
    project='neutron_openvswitch_agent')

with neutron_openvswitch_agent.version(
        '2013.2.1') as neutron_openvswitch_agent_2013_2_1:

    neutron_openvswitch_agent_2013_2_1.section('ml2')

    neutron_openvswitch_agent_2013_2_1.param(
        'type_drivers', type='string', default='local,flat,vlan,gre,vxlan')

    neutron_openvswitch_agent_2013_2_1.param('tenant_network_types',
                                             type='string',
                                             default='local')

    neutron_openvswitch_agent_2013_2_1.param(
        'mechanism_drivers',
        type='string',
        default='',
        description=
        "(ListOpt) Ordered list of networking mechanism driver entrypoints to be loaded from the neutron.ml2.mechanism_drivers namespace."
    )

    neutron_openvswitch_agent_2013_2_1.section('ml2_type_flat')

    neutron_openvswitch_agent_2013_2_1.param('flat_networks',
                                             type='string',
                                             default='')
示例#11
0
from rubick.schema import ConfigSchemaRegistry

glance_registry = ConfigSchemaRegistry.register_schema(
    project='glance_registry')

with glance_registry.version('2013.2.1') as glance_registry_2013_2_1:

    glance_registry_2013_2_1.section('DEFAULT')

    glance_registry_2013_2_1.param('verbose', type='string', default='False',
                                   description="Show more verbose log output (sets INFO log level output)")

    glance_registry_2013_2_1.param('debug', type='string', default='False',
                                   description="Show debugging output in logs (sets DEBUG log level output)")

    glance_registry_2013_2_1.param(
        'bind_host', type='host', default='0.0.0.0', description="Address to bind the registry server")

    glance_registry_2013_2_1.param(
        'bind_port', type='string', default='9191', description="Port the bind the registry server to")

    glance_registry_2013_2_1.param(
        'log_file', type='string', default='/var/log/glance/registry.log',
        description="Log to this file. Make sure you do not set the same log file for both the API and registry servers!")

    glance_registry_2013_2_1.param(
        'backlog', type='string', default='4096', description="Backlog requests when creating socket")

    glance_registry_2013_2_1.param(
        'tcp_keepidle', type='string', default='600',
        description="TCP_KEEPIDLE value in seconds when creating socket. Not supported on OS X.")
示例#12
0
from rubick.schema import ConfigSchemaRegistry

swift = ConfigSchemaRegistry.register_schema(project='swift')

with swift.version('2013.2') as swift_2013_2:

    swift_2013_2.section('swift-hash')

    swift_2013_2.param('swift_hash_path_suffix',
                       type='string', default='changeme', description="")

    swift_2013_2.param('swift_hash_path_prefix',
                       type='string', default='changeme', description="")

    swift_2013_2.section('swift-constraints')

    swift_2013_2.param(
        'max_file_size', type='string', default='5368709122', description="")

    swift_2013_2.param('max_meta_name_length',
                       type='string', default='128', description="")

    swift_2013_2.param('max_meta_value_length',
                       type='string', default='256', description="")

    swift_2013_2.param(
        'max_meta_count', type='string', default='90', description="")

    swift_2013_2.param('max_meta_overall_size',
                       type='string', default='4096', description="")
示例#13
0
from rubick.schema import ConfigSchemaRegistry

neutron_metadata_agent = ConfigSchemaRegistry.register_schema(
    project='neutron_metadata_agent')

with neutron_metadata_agent.version('2013.2.1') as neutron_metadata_agent_2013_2_1:

    neutron_metadata_agent_2013_2_1.section('DEFAULT')

    neutron_metadata_agent_2013_2_1.param(
        'debug', type='string', default='True', description="Show debugging output in log (sets DEBUG log level output)")

    neutron_metadata_agent_2013_2_1.param(
        'auth_url', type='string', default='http://localhost:5000/v2.0', description="The Neutron user information for accessing the Neutron API.")

    neutron_metadata_agent_2013_2_1.param(
        'auth_region', type='string', default='RegionOne', description="The Neutron user information for accessing the Neutron API.")

    neutron_metadata_agent_2013_2_1.param(
        'admin_tenant_name', type='string', default='%SERVICE_TENANT_NAME%', description="The Neutron user information for accessing the Neutron API.")

    neutron_metadata_agent_2013_2_1.param(
        'admin_user', type='string', default='%SERVICE_USER%', description="The Neutron user information for accessing the Neutron API.")

    neutron_metadata_agent_2013_2_1.param(
        'admin_password', type='string', default='%SERVICE_PASSWORD%', description="The Neutron user information for accessing the Neutron API.")

    neutron_metadata_agent_2013_2_1.param(
        'endpoint_type', type='string', default='adminURL', description="Network service endpoint type to pull from the keystone catalog")

    neutron_metadata_agent_2013_2_1.param(
示例#14
0
from rubick.schema import ConfigSchemaRegistry

neutron_server = ConfigSchemaRegistry.register_schema(project='neutron_server')

with neutron_server.version('2013.2.1') as neutron_server_2013_2_1:

    neutron_server_2013_2_1.section('DEFAULT')

    neutron_server_2013_2_1.param(
        'verbose',
        type='string',
        default='False',
        description=
        "Default log level is INFO verbose and debug has the same result. One of them will set DEBUG log level output"
    )

    neutron_server_2013_2_1.param(
        'state_path',
        type='string',
        default='/var/lib/neutron',
        description=
        "Where to store Neutron state files.  This directory must be writable by the user executing the agent."
    )

    neutron_server_2013_2_1.param('lock_path',
                                  type='string',
                                  default='$state_path/lock',
                                  description="Where to store lock files")

    neutron_server_2013_2_1.param(
        'log_format',
示例#15
0
from rubick.schema import ConfigSchemaRegistry

keystone = ConfigSchemaRegistry.register_schema(project='keystone')

with keystone.version('2013.1.3', checkpoint=True) as keystone_2013_1_3:

    keystone_2013_1_3.param(
        'admin_token',
        type='string',
        default='ADMIN',
        description="A 'shared secret' between keystone and other openstack "
                    "services")

    keystone_2013_1_3.param(
        'bind_host',
        type='host',
        default='0.0.0.0',
        description="The IP address of the network interface to listen on")

    keystone_2013_1_3.param(
        'public_port',
        type='port',
        default='5000',
        description="The port number which the public service listens on")

    keystone_2013_1_3.param(
        'admin_port',
        type='port',
        default='35357',
        description="The port number which the public admin listens on")
示例#16
0
from rubick.schema import ConfigSchemaRegistry

glance_api = ConfigSchemaRegistry.register_schema(project='glance_api')

with glance_api.version('2013.2.1') as glance_api_2013_2_1:

    glance_api_2013_2_1.section('DEFAULT')

    glance_api_2013_2_1.param('verbose', type='string', default='False',
                              description="Show more verbose log output (sets INFO log level output)")

    glance_api_2013_2_1.param('debug', type='string', default='False',
                              description="Show debugging output in logs (sets DEBUG log level output)")

    glance_api_2013_2_1.param('default_store', type='string', default='file',
                              description="Which backend scheme should Glance use by default is not specified in a request to add a new image to Glance? Known schemes are determined by the known_stores option below. Default: 'file'")

    glance_api_2013_2_1.param(
        'known_stores', type='string', default='glance.store.filesystem.Store,',
        description="List of which store classes and store class locations are currently known to glance at startup.")

    glance_api_2013_2_1.param(
        'image_size_cap', type='string', default='1099511627776',
        description="Maximum image size (in bytes) that may be uploaded through the Glance API server. Defaults to 1 TB. WARNING: this value should only be increased after careful consideration and must be set to a value under 8 EB (9223372036854775808).")

    glance_api_2013_2_1.param(
        'bind_host', type='host', default='0.0.0.0', description="Address to bind the API server")

    glance_api_2013_2_1.param(
        'bind_port', type='string', default='9292', description="Port the bind the API server to")
示例#17
0
from rubick.schema import ConfigSchemaRegistry

neutron_dhcp_agent = ConfigSchemaRegistry.register_schema(
    project='neutron_dhcp_agent')

with neutron_dhcp_agent.version('2013.2.1') as neutron_dhcp_agent_2013_2_1:

    neutron_dhcp_agent_2013_2_1.section('DEFAULT')

    neutron_dhcp_agent_2013_2_1.param(
        'debug',
        type='string',
        default='False',
        description="Show debugging output in log (sets DEBUG log level output)"
    )

    neutron_dhcp_agent_2013_2_1.param(
        'resync_interval',
        type='string',
        default='5',
        description=
        "The DHCP agent will resync its state with Neutron to recover from any transient notification or rpc errors. The interval is number of seconds between attempts."
    )

    neutron_dhcp_agent_2013_2_1.param(
        'interface_driver',
        type='string',
        default='',
        description=
        "The DHCP agent requires an interface driver be set. Choose the one that best matches your plugin."
    )
示例#18
0
文件: v3_0_0.py 项目: plomakin/rubick
from rubick.schema import ConfigSchemaRegistry

rabbitmq = ConfigSchemaRegistry.register_schema(project='rabbitmq')

with rabbitmq.version('3.0.0', checkpoint=True) as cfg:
    cfg.param(
        'tcp_listeners', type='rabbitmq_bind_list', default=[5672],
        description="List of ports on which to listen for AMQP connections (without SSL)")

    cfg.param(
        'ssl_listeners', type='rabbitmq_bind_list', default=[],
        description="List of ports on which to listen for AMQP connections (SSL)")

    cfg.param('ssl_options', type='string_list', default=[])

    cfg.param('vm_memory_high_watermark', type='float', default=0.4)

    cfg.param('vm_memory_high_watermark_paging_ratio',
              type='float', default=0.5)

    cfg.param('disk_free_limit', type='integer', default='50000000')
    cfg.param('log_levels', type='string_list', default=['{connection, info}'])
    cfg.param('frame_max', type='integer', default=131072)
    cfg.param('heartbeat', type='integer', default=600)
    cfg.param('default_vhost', type='string', default='/')
    cfg.param('default_user', type='string', default='guest')
    cfg.param('default_pass', type='string', default='guest')
示例#19
0
from rubick.schema import ConfigSchemaRegistry

glance_registry = ConfigSchemaRegistry.register_schema(
    project='glance_registry')

with glance_registry.version('2013.2.1') as glance_registry_2013_2_1:

    glance_registry_2013_2_1.section('DEFAULT')

    glance_registry_2013_2_1.param(
        'verbose',
        type='string',
        default='False',
        description="Show more verbose log output (sets INFO log level output)"
    )

    glance_registry_2013_2_1.param(
        'debug',
        type='string',
        default='False',
        description=
        "Show debugging output in logs (sets DEBUG log level output)")

    glance_registry_2013_2_1.param(
        'bind_host',
        type='host',
        default='0.0.0.0',
        description="Address to bind the registry server")

    glance_registry_2013_2_1.param(
        'bind_port',