Пример #1
0
class URIConfigurationSourceDriver(sources.ConfigurationSourceDriver):
    """A backend driver for remote files served through http[s].

    Required options:
      - uri: URI containing the file location.

    Non-required options:
      - ca_path: The path to a CA_BUNDLE file or directory with
                 certificates of trusted CAs.

      - client_cert: Client side certificate, as a single file path
                     containing either the certificate only or the
                     private key and the certificate.

      - client_key: Client side private key, in case client_cert is
                    specified but does not includes the private key.
    """

    _uri_driver_opts = [
        cfg.URIOpt(
            'uri',
            schemes=['http', 'https'],
            required=True,
            sample_default='https://example.com/my-configuration.ini',
            help=('Required option with the URI of the '
                  'extra configuration file\'s location.'),
        ),
        cfg.StrOpt(
            'ca_path',
            sample_default='/etc/ca-certificates',
            help=('The path to a CA_BUNDLE file or directory '
                  'with certificates of trusted CAs.'),
        ),
        cfg.StrOpt(
            'client_cert',
            sample_default='/etc/ca-certificates/service-client-keystore',
            help=('Client side certificate, as a single file path '
                  'containing either the certificate only or the '
                  'private key and the certificate.'),
        ),
        cfg.StrOpt(
            'client_key',
            help=('Client side private key, in case client_cert is '
                  'specified but does not includes the private key.'),
        ),
    ]

    def list_options_for_discovery(self):
        return self._uri_driver_opts

    def open_source_from_opt_group(self, conf, group_name):
        conf.register_opts(self._uri_driver_opts, group_name)

        return URIConfigurationSource(conf[group_name].uri,
                                      conf[group_name].ca_path,
                                      conf[group_name].client_cert,
                                      conf[group_name].client_key)
Пример #2
0
import testtools

from ceilometerclient.v2 import client as metering_client
from cinderclient.v2 import client as volume_client
from glanceclient.v2 import client as image_client
from keystoneauth1 import session
from keystoneauth1.identity import v3
from keystoneclient.v3 import client as identity_client
from neutronclient.v2_0 import client as network_client
from novaclient import client as compute_client
from oslo_config import cfg
from sentinel.conf import opts
from sentinel import adaptors

OPTS = [
    cfg.URIOpt('auth_url', help='URL of the sentinel identity service'),
    cfg.StrOpt('tls_ca', help='CA certificate of sentinel server'),
    cfg.StrOpt('tls_cert', help='Certificate for the sentinel client'),
    cfg.StrOpt('tls_key', help='Private key for the sentinel client'),
]

OPTS_GROUP = cfg.OptGroup(
    'functional_test',
    title='Sentinel Authentication',
    help='Access credentials for a sentinel instance used in testing')


@adaptors.rawclientadaptor
class NeutronClient(network_client.Client):
    """Wrapped neutron client which returns Resources not raw data"""
    pass
Пример #3
0
from cinder import compute
from cinder import exception
from cinder.i18n import _
from cinder.image import image_utils
from cinder import interface
from cinder import utils
from cinder.volume.drivers import remotefs as remotefs_drv

VERSION = '1.1.1'

LOG = logging.getLogger(__name__)

volume_opts = [
    cfg.URIOpt('quobyte_volume_url',
               help=('URL to the Quobyte volume e.g.,'
                     ' quobyte://<DIR host>/<volume name>')),
    cfg.StrOpt('quobyte_client_cfg',
               help=('Path to a Quobyte Client configuration file.')),
    cfg.BoolOpt('quobyte_sparsed_volumes',
                default=True,
                help=('Create volumes as sparse files which take no space.'
                      ' If set to False, volume is created as regular file.'
                      'In such case volume creation takes a lot of time.')),
    cfg.BoolOpt('quobyte_qcow2_volumes',
                default=True,
                help=('Create volumes as QCOW2 files rather than raw files.')),
    cfg.StrOpt('quobyte_mount_point_base',
               default='$state_path/mnt',
               help=('Base dir containing the mount point'
                     ' for the Quobyte volume.')),
Пример #4
0
bootstrap` command. The value of this option is treated as a "shared secret"
that can be used to bootstrap Keystone through the API. This "token" does not
represent a user (it has no identity), and carries no explicit authorization
(it effectively bypasses most authorization checks). If set to `None`, the
value is ignored and the `admin_token` middleware is effectively disabled.
However, to completely disable `admin_token` in production (highly recommended,
as it presents a security risk), remove `AdminTokenAuthMiddleware`
(the `admin_token_auth` filter) from your paste application pipelines (for
example, in `keystone-paste.ini`).
"""))

public_endpoint = cfg.URIOpt('public_endpoint',
                             help=utils.fmt("""
The base public endpoint URL for Keystone that is advertised to clients (NOTE:
this does NOT affect how Keystone listens for connections). Defaults to the
base host URL of the request. For example, if keystone receives a request to
`http://server:5000/v3/users`, then this will option will be automatically
treated as `http://server:5000`. You should only need to set option if either
the value of the base URL contains a path that keystone does not automatically
infer (`/prefix/v3`), or if the endpoint should be found on a different host.
"""))

admin_endpoint = cfg.URIOpt('admin_endpoint',
                            help=utils.fmt("""
The base admin endpoint URL for Keystone that is advertised to clients (NOTE:
this does NOT affect how Keystone listens for connections). Defaults to the
base host URL of the request. For example, if keystone receives a request to
`http://server:35357/v3/users`, then this will option will be automatically
treated as `http://server:35357`. You should only need to set option if either
the value of the base URL contains a path that keystone does not automatically
infer (`/prefix/v3`), or if the endpoint should be found on a different host.
"""))
Пример #5
0
* auth_type
* auth_url
* project_name
* username
* password
* project_domain_id or project_domain_name
* user_domain_id or user_domain_name
""")

ironic_options = [
    cfg.URIOpt(
        'api_endpoint',
        schemes=['http', 'https'],
        deprecated_for_removal=True,
        deprecated_reason='Endpoint lookup uses the service catalog via '
        'common keystoneauth1 Adapter configuration '
        'options. In the current release, api_endpoint will '
        'override this behavior, but will be ignored and/or '
        'removed in a future release. To achieve the same '
        'result, use the endpoint_override option instead.',
        sample_default='http://ironic.example.org:6385/',
        help='URL override for the Ironic API endpoint.'),
    cfg.IntOpt(
        'api_max_retries',
        # TODO(raj_singh): Change this default to some sensible number
        default=60,
        min=0,
        help="""
The number of times to retry when a request conflicts.
If set to 0, only try once, no retries.

Related options:
Пример #6
0
               help='Storage class of GCS bucket.'),
    cfg.StrOpt('backup_gcs_credential_file',
               help='Absolute path of GCS service account credential file.'),
    cfg.StrOpt('backup_gcs_project_id',
               help='Owner project id for GCS bucket.'),
    cfg.StrOpt('backup_gcs_user_agent',
               default='gcscinder',
               help='Http user-agent string for gcs api.'),
    cfg.BoolOpt('backup_gcs_enable_progress_timer',
                default=True,
                help='Enable or Disable the timer to send the periodic '
                'progress notifications to Ceilometer when backing '
                'up the volume to the GCS backend storage. The '
                'default value is True to enable the timer.'),
    cfg.URIOpt('backup_gcs_proxy_url',
               help='URL for http proxy access.',
               secret=True),
]

CONF = cfg.CONF
CONF.register_opts(gcsbackup_service_opts)
OAUTH_EXCEPTIONS = None


def gcs_logger(func):
    def func_wrapper(self, *args, **kwargs):
        try:
            return func(self, *args, **kwargs)
        except errors.Error as err:
            raise exception.GCSApiFailure(reason=err)
        except OAUTH_EXCEPTIONS as err:
Пример #7
0
This option adds a virtual serial port which sends console output to
a configurable service URI. At the service URI address there will be
virtual serial port concentrator that will collect console logs.
If this is not set, no serial ports will be added to the created VMs.

Possible values:

* Any valid URI
"""),
    cfg.URIOpt('serial_port_proxy_uri',
               schemes=['telnet', 'telnets'],
               help="""
Identifies a proxy service that provides network access to the
serial_port_service_uri.

Possible values:

* Any valid URI (The scheme is 'telnet' or 'telnets'.)

Related options:
This option is ignored if serial_port_service_uri is not specified.
* serial_port_service_uri
"""),
    cfg.StrOpt('serial_log_dir',
               default='/opt/vmware/vspc',
               help="""
Specifies the directory where the Virtual Serial Port Concentrator is
storing console log files. It should match the 'serial_log_dir' config
value of VSPC.
"""),
]
Пример #8
0
  waiting between attempts.

Related options:

* ebtables_exec_attempts
"""),
]

ldap_dns_opts = [
    cfg.URIOpt('ldap_dns_url',
               default='ldap://ldap.example.com:389',
               deprecated_for_removal=True,
               deprecated_since='16.0.0',
               deprecated_reason="""
nova-network is deprecated, as are any related configuration options.
""",
               help="""
URL for LDAP server which will store DNS entries

Possible values:

* A valid LDAP URL representing the server
"""),
    cfg.StrOpt('ldap_dns_user',
               default='uid=admin,ou=people,dc=example,dc=org',
               deprecated_for_removal=True,
               deprecated_since='16.0.0',
               deprecated_reason="""
nova-network is deprecated, as are any related configuration options.
""",
               help='Bind user for LDAP server'),
    cfg.StrOpt('ldap_dns_password',
Пример #9
0
from oslo_config import cfg

from neutron._i18n import _
from neutron.conf.agent import common as config


agent_opts = [
    cfg.IntOpt(
        'polling_interval',
        default=2,
        help=_("The number of seconds the agent will wait between "
        "polling for local device changes.")),
    cfg.URIOpt('cloud_connector_url',
               schemes=['http', 'https'],
               sample_default='http://zvm.example.org:8080/',
               help="""
URL to be used to communicate with z/VM Cloud Connector.
"""),
    cfg.StrOpt('zvm_cloud_connector_ca_file',
               default=None,
               help="""
CA certificate file to be verified in httpd server.
A string, it must be a path to a CA bundle to use.
"""),
    cfg.StrOpt('zvm_cloud_connector_token_file',
               default=None,
               help="""
Token file that contains admin-token to access sdk http server.
"""),
]
Пример #10
0
NEUTRON_GROUP = 'neutron'

neutron_group = cfg.OptGroup(NEUTRON_GROUP,
                             title='Neutron Options',
                             help="""
Configuration options for neutron (network connectivity as a service).
""")

neutron_opts = [
    cfg.URIOpt('url',
               default='http://127.0.0.1:9696',
               help="""
This option specifies the URL for connecting to Neutron.

Possible values:

* Any valid URL that points to the Neutron API service is appropriate here.
  This typically matches the URL returned for the 'network' service type
  from the Keystone service catalog.
"""),
    cfg.StrOpt('region_name',
               default='RegionOne',
               help="""
Region name for connecting to Neutron in admin context.

This option is used in multi-region setups. If there are two Neutron
servers running in two regions in two different machines, then two
services need to be created in Keystone with two different regions and
associate corresponding endpoints to those services. When requests are made
to Keystone, the Keystone service uses the region_name to determine the
Пример #11
0
from oslo_config import cfg

from ironic.common.i18n import _

opts = [
    cfg.IntOpt('workers_pool_size',
               default=100, min=3,
               help=_('The size of the workers greenthread pool. '
                      'Note that 2 threads will be reserved by the conductor '
                      'itself for handling heart beats and periodic tasks.')),
    cfg.IntOpt('heartbeat_interval',
               default=10,
               help=_('Seconds between conductor heart beats.')),
    cfg.URIOpt('api_url',
               schemes=('http', 'https'),
               help=_('URL of Ironic API service. If not set ironic can '
                      'get the current value from the keystone service '
                      'catalog. If set, the value must start with either '
                      'http:// or https://.')),
    cfg.IntOpt('heartbeat_timeout',
               default=60,
               help=_('Maximum time (in seconds) since the last check-in '
                      'of a conductor. A conductor is considered inactive '
                      'when this time has been exceeded.')),
    cfg.IntOpt('sync_power_state_interval',
               default=60,
               help=_('Interval between syncing the node power state to the '
                      'database, in seconds.')),
    cfg.IntOpt('check_provision_state_interval',
               default=60,
               help=_('Interval between checks of provision timeouts, '
                      'in seconds.')),
Пример #12
0
               deprecated_for_removal=True,
               deprecated_since="11.0.0",
               deprecated_reason='Use the [nova] section to configure '
               'Keystone authentication for a privileged user.',
               secret=True),
    cfg.StrOpt('os_privileged_user_tenant',
               help='Tenant name associated with the OpenStack privileged '
                    'account.',
               deprecated_for_removal=True,
               deprecated_since="11.0.0",
               deprecated_reason='Use the [nova] section to configure '
               'Keystone authentication for a privileged user.'),
    cfg.URIOpt('os_privileged_user_auth_url',
               help='Auth URL associated with the OpenStack privileged '
                    'account.',
               deprecated_for_removal=True,
               deprecated_since="11.0.0",
               deprecated_reason='Use the [nova] section to configure '
               'Keystone authentication for a privileged user.')
]

CONF.register_opts(core_opts)
CONF.register_opts(global_opts)


def set_middleware_defaults():
    """Update default configuration options for oslo.middleware."""

    cors.set_defaults(
        allow_headers=['X-Auth-Token',
                       'X-Identity-Status',
Пример #13
0
Related options:
Following options must be set to provide console access.
* mksproxy_base_url
* enabled
""")

mks_opts = [
    cfg.URIOpt('mksproxy_base_url',
               schemes=['http', 'https'],
               default='http://127.0.0.1:6090/',
               help="""
Location of MKS web console proxy

The URL in the response points to a WebMKS proxy which
starts proxying between client and corresponding vCenter
server where instance runs. In order to use the web based
console access, WebMKS proxy should be installed and configured

Possible values:

* Must be a valid URL of the form:``http://host:port/`` or
  ``https://host:port/``
"""),
    cfg.BoolOpt('enabled',
                default=False,
                help="""
Enables graphical console access for virtual machines.
"""),
]

Пример #14
0
cannot contain a comma (`,`).
"""))

keyfile = cfg.StrOpt(
    'keyfile',
    default=constants._KEYFILE,
    help=utils.fmt("""
Absolute path to the private key file to use for SAML signing. The value cannot
contain a comma (`,`).
"""))

idp_entity_id = cfg.URIOpt(
    'idp_entity_id',
    max_length=1024,
    help=utils.fmt("""
This is the unique entity identifier of the identity provider (keystone) to use
when generating SAML assertions. This value is required to generate identity
provider metadata and must be a URI (a URL is recommended). For example:
`https://keystone.example.com/v3/OS-FEDERATION/saml2/idp`.
"""))

idp_sso_endpoint = cfg.URIOpt(
    'idp_sso_endpoint',
    help=utils.fmt("""
This is the single sign-on (SSO) service location of the identity provider
which accepts HTTP POST requests. A value is required to generate identity
provider metadata. For example:
`https://keystone.example.com/v3/OS-FEDERATION/saml2/sso`.
"""))

idp_lang = cfg.StrOpt(
Пример #15
0
    cfg.StrOpt('db_file',
               default='/tmp/db.json',
               help='Location of database for discovered servers'),
    cfg.StrOpt('progress_file',
               default='/tmp/progress.json',
               help='Location of file to track progress through UI'),
    cfg.StrOpt(
        'restart_trigger_file',
        default='/tmp/cloud_install_ui_trigger.txt',
        help='Location of file to trigger a flask restart to pickup new configs'
    ),
    cfg.StrOpt('ui_home',
               default='web',
               help='Location of static files to serve'),
    cfg.URIOpt('ardana_service_url',
               default='http://localhost:9085',
               help='URL of ardana service'),
]

url_opts = [
    cfg.StrOpt('horizon', help='Location of horizon UI'),
    cfg.StrOpt('opsconsole', help='Location of operations console UI'),
]

url_group = cfg.OptGroup(name='urls',
                         title='URLs to be displayed on the completion page')

CONF = cfg.CONF
CONF.register_opts(general_opts, 'general')
CONF.register_group(url_group)
CONF.register_opts(url_opts, url_group)
Пример #16
0
* Better mouse integration - The mouse can be captured and released without
  needing to click inside the console or press keys to release it. The
  performance of mouse movement is also improved.
"""),
    cfg.URIOpt('html5proxy_base_url',
               default='http://127.0.0.1:6082/spice_auto.html',
               help="""
Location of the SPICE HTML5 console proxy.

End user would use this URL to connect to the `nova-spicehtml5proxy``
service. This service will forward request to the console of an instance.

In order to use SPICE console, the service ``nova-spicehtml5proxy`` should be
running. This service is typically launched on the controller node.

Possible values:

* Must be a valid URL of the form:  ``http://host:port/spice_auto.html``
  where host is the node running ``nova-spicehtml5proxy`` and the port is
  typically 6082. Consider not using default value as it is not well defined
  for any real deployment.

Related options:

* This option depends on ``html5proxy_host`` and ``html5proxy_port`` options.
  The access URL returned by the compute node must have the host
  and port where the ``nova-spicehtml5proxy`` service is listening.
"""),
    cfg.StrOpt('server_listen',
               default='127.0.0.1',
               help="""
The  address where the SPICE server running on the instances should listen.
Пример #17
0
 def test_encode_uri(self):
     """Test the json encoding of a URI"""
     opt = cfg.URIOpt('opt', 100)
     expected = '"type": {"max_length": 100, "type": "URI"}'
     self._test_encode_specific(opt, expected)
Пример #18
0
    waiting between attempts.

Related options:

    * ebtables_exec_attempts
"""),
]

ldap_dns_opts = [
    # TODO(siva_krishnan): Validate URL scheme once that feature is added
    # in oslo_config
    cfg.URIOpt('ldap_dns_url',
        default='ldap://ldap.example.com:389',
        help="""
URL for LDAP server which will store DNS entries

Possible values:

* A valid LDAP URL representing the server
"""),
    cfg.StrOpt('ldap_dns_user',
        default='uid=admin,ou=people,dc=example,dc=org',
        help='Bind user for LDAP server'),
    cfg.StrOpt('ldap_dns_password',
        default='password',
        secret=True,
        help="Bind user's password for LDAP server"),
    cfg.StrOpt('ldap_dns_soa_hostmaster',
        default='*****@*****.**',
        help="""
Hostmaster for LDAP DNS driver Statement of Authority
Пример #19
0
* Each string which passes the regex ``^\d+:\d+$`` For example ``10000:20000``.
  Be sure that the first port number is lower than the second port number
  and that both are in range from 0 to 65535.
"""),
    # TODO(macsz) check if WS protocol is still being used
    cfg.URIOpt('base_url',
               default='ws://127.0.0.1:6083/',
               help="""
The URL an end user would use to connect to the ``nova-serialproxy`` service.

The ``nova-serialproxy`` service is called with this token enriched URL
and establishes the connection to the proper instance.

Related options:

* The IP address must be identical to the address to which the
  ``nova-serialproxy`` service is listening (see option ``serialproxy_host``
  in this section).
* The port must be the same as in the option ``serialproxy_port`` of this
  section.
* If you choose to use a secured websocket connection, then start this option
  with ``wss://`` instead of the unsecured ``ws://``. The options ``cert``
  and ``key`` in the ``[DEFAULT]`` section have to be set for that.
"""),
    cfg.StrOpt('proxyclient_address',
               default='127.0.0.1',
               help="""
The IP address to which proxy clients (like ``nova-serialproxy``) should
connect to get the serial console of an instance.
Пример #20
0
users to access their instances through VNC clients.

This option sets the private address to which proxy clients, such as
``nova-novncproxy``, should connect to.
"""),
    cfg.URIOpt('novncproxy_base_url',
               default='http://127.0.0.1:6080/vnc_auto.html',
               deprecated_group='DEFAULT',
               help="""
Public address of noVNC VNC console proxy.

The VNC proxy is an OpenStack component that enables compute service
users to access their instances through VNC clients. noVNC provides
VNC support through a websocket-based client.

This option sets the public base URL to which client systems will
connect. noVNC clients can use this address to connect to the noVNC
instance and, by extension, the VNC sessions.

If using noVNC >= 1.0.0, you should use ``vnc_lite.html`` instead of
``vnc_auto.html``.

Related options:

* novncproxy_host
* novncproxy_port
"""),
]

CLI_OPTS = [
    cfg.StrOpt('novncproxy_host',
               default='0.0.0.0',
Пример #21
0
from oslo_config import cfg
from oslo_log import log as logging
from oslo_utils import timeutils
import six
from swiftclient import client as swift

from cinder.backup import chunkeddriver
from cinder import exception
from cinder.i18n import _
from cinder import interface

LOG = logging.getLogger(__name__)

swiftbackup_service_opts = [
    cfg.URIOpt('backup_swift_url',
               help='The URL of the Swift endpoint'),
    cfg.URIOpt('backup_swift_auth_url',
               help='The URL of the Keystone endpoint'),
    cfg.StrOpt('swift_catalog_info',
               default='object-store:swift:publicURL',
               help='Info to match when looking for swift in the service '
               'catalog. Format is: separated values of the form: '
               '<service_type>:<service_name>:<endpoint_type> - '
               'Only used if backup_swift_url is unset'),
    cfg.StrOpt('keystone_catalog_info',
               default='identity:Identity Service:publicURL',
               help='Info to match when looking for keystone in the service '
               'catalog. Format is: separated values of the form: '
               '<service_type>:<service_name>:<endpoint_type> - '
               'Only used if backup_swift_auth_url is unset'),
    cfg.StrOpt('backup_swift_auth',
Пример #22
0
from oslo_config import cfg

_CONFIG_FILES = [
    os.path.join(os.path.dirname(__file__), "remote_file_manager.conf"),
]

_CONFIG_OPTS = {
    "site": [
        cfg.StrOpt("title",
                   default="Oslo Config • Remote File Manager",
                   help='website title.'),
    ],
    "db": [
        cfg.URIOpt('mongo_uri',
                   default='mongodb://mongodb:27017/remote_file',
                   help='Connection string for MongoDB.'),
    ],
}


def set_config(app):
    conf = cfg.ConfigOpts()

    for group, opts in _CONFIG_OPTS.items():
        conf.register_opts(opts, group)

    conf(default_config_files=_CONFIG_FILES)

    app.config["site"] = conf.site
    app.config["MONGO_URI"] = conf.db.mongo_uri
Пример #23
0
class GeneratorTestCase(base.BaseTestCase):

    groups = {
        'group1':
        cfg.OptGroup(name='group1',
                     help='Lorem ipsum dolor sit amet, consectetur '
                     'adipisicing elit, sed do eiusmod tempor '
                     'incididunt ut labore et dolore magna '
                     'aliqua. Ut enim ad minim veniam, quis '
                     'nostrud exercitation ullamco laboris '
                     'nisi ut aliquip ex ea commodo '
                     'consequat. Duis aute irure dolor in.'),
        'group2':
        cfg.OptGroup(name='group2', title='Group 2'),
        'foo':
        cfg.OptGroup(name='foo', title='Foo Title', help='foo help'),
    }

    opts = {
        'foo':
        cfg.StrOpt('foo', help='foo option'),
        'bar':
        cfg.StrOpt('bar', help='bar option'),
        'foo-bar':
        cfg.StrOpt('foo-bar', help='foobar'),
        'no_help':
        cfg.StrOpt('no_help'),
        'long_help':
        cfg.StrOpt('long_help',
                   help='Lorem ipsum dolor sit amet, consectetur '
                   'adipisicing elit, sed do eiusmod tempor '
                   'incididunt ut labore et dolore magna '
                   'aliqua. Ut enim ad minim veniam, quis '
                   'nostrud exercitation ullamco laboris '
                   'nisi ut aliquip ex ea commodo '
                   'consequat. Duis aute irure dolor in '
                   'reprehenderit in voluptate velit esse '
                   'cillum dolore eu fugiat nulla '
                   'pariatur. Excepteur sint occaecat '
                   'cupidatat non proident, sunt in culpa '
                   'qui officia deserunt mollit anim id est '
                   'laborum.'),
        'long_help_pre':
        cfg.StrOpt('long_help_pre',
                   help='This is a very long help text which '
                   'is preformatted with line breaks. '
                   'It should break when it is too long '
                   'but also keep the specified line '
                   'breaks. This makes it possible to '
                   'create lists with items:\n'
                   '\n'
                   '* item 1\n'
                   '* item 2\n'
                   '\n'
                   'and should increase the '
                   'readability.'),
        'choices_opt':
        cfg.StrOpt('choices_opt',
                   default='a',
                   choices=(None, '', 'a', 'b', 'c'),
                   help='a string with choices'),
        'deprecated_opt_without_deprecated_group':
        cfg.StrOpt('bar', deprecated_name='foobar', help='deprecated'),
        'deprecated_for_removal_opt':
        cfg.StrOpt('bar',
                   deprecated_for_removal=True,
                   help='deprecated for removal'),
        'deprecated_reason_opt':
        cfg.BoolOpt(
            'turn_off_stove',
            default=False,
            deprecated_for_removal=True,
            deprecated_reason='This was supposed to work but it really, '
            'really did not. Always buy house insurance.',
            help='DEPRECATED: Turn off stove'),
        'deprecated_opt_with_deprecated_since':
        cfg.BoolOpt('tune_in',
                    deprecated_for_removal=True,
                    deprecated_since='13.0'),
        'deprecated_opt_with_deprecated_group':
        cfg.StrOpt('bar',
                   deprecated_name='foobar',
                   deprecated_group='group1',
                   help='deprecated'),
        'opt_with_DeprecatedOpt':
        cfg.BoolOpt(
            'foo-bar',
            help='Opt with DeprecatedOpt',
            deprecated_opts=[cfg.DeprecatedOpt('foo-bar',
                                               group='deprecated')]),
        # Unknown Opt default must be a string
        'unknown_type':
        cfg.Opt('unknown_opt',
                default='123',
                help='unknown',
                type=types.String(type_name='unknown type')),
        'str_opt':
        cfg.StrOpt('str_opt', default='foo bar', help='a string'),
        'str_opt_sample_default':
        cfg.StrOpt('str_opt', default='fooishbar', help='a string'),
        'str_opt_with_space':
        cfg.StrOpt('str_opt',
                   default='  foo bar  ',
                   help='a string with spaces'),
        'bool_opt':
        cfg.BoolOpt('bool_opt', default=False, help='a boolean'),
        'int_opt':
        cfg.IntOpt('int_opt', default=10, min=1, max=20, help='an integer'),
        'int_opt_min_0':
        cfg.IntOpt('int_opt_min_0',
                   default=10,
                   min=0,
                   max=20,
                   help='an integer'),
        'int_opt_max_0':
        cfg.IntOpt('int_opt_max_0', default=-1, max=0, help='an integer'),
        'float_opt':
        cfg.FloatOpt('float_opt', default=0.1, help='a float'),
        'list_opt':
        cfg.ListOpt('list_opt', default=['1', '2', '3'], help='a list'),
        'dict_opt':
        cfg.DictOpt('dict_opt', default={
            '1': 'yes',
            '2': 'no'
        }, help='a dict'),
        'ip_opt':
        cfg.IPOpt('ip_opt', default='127.0.0.1', help='an ip address'),
        'port_opt':
        cfg.PortOpt('port_opt', default=80, help='a port'),
        'hostname_opt':
        cfg.HostnameOpt('hostname_opt',
                        default='compute01.nova.site1',
                        help='a hostname'),
        'uri_opt':
        cfg.URIOpt('uri_opt', default='http://example.com', help='a URI'),
        'multi_opt':
        cfg.MultiStrOpt('multi_opt',
                        default=['1', '2', '3'],
                        help='multiple strings'),
        'multi_opt_none':
        cfg.MultiStrOpt('multi_opt_none', help='multiple strings'),
        'multi_opt_empty':
        cfg.MultiStrOpt('multi_opt_empty', default=[],
                        help='multiple strings'),
        'multi_opt_sample_default':
        cfg.MultiStrOpt('multi_opt',
                        default=['1', '2', '3'],
                        sample_default=['5', '6'],
                        help='multiple strings'),
        'string_type_with_bad_default':
        cfg.Opt('string_type_with_bad_default',
                help='string with bad default',
                default=4096),
        'native_str_type':
        cfg.Opt('native_str_type', help='native help', type=str),
        'native_int_type':
        cfg.Opt('native_int_type', help='native help', type=int),
        'native_float_type':
        cfg.Opt('native_float_type', help='native help', type=float),
        'custom_type':
        cfg.Opt('custom_type', help='custom help', type=custom_type),
        'custom_type_name':
        cfg.Opt('custom_opt_type',
                type=types.Integer(type_name='port'
                                   ' number'),
                default=5511,
                help='this is a port'),
    }

    content_scenarios = [
        ('empty', dict(opts=[], expected='''[DEFAULT]
''')),
        ('single_namespace',
         dict(opts=[('test', [(None, [opts['foo']])])],
              expected='''[DEFAULT]

#
# From test
#

# foo option (string value)
#foo = <None>
''')),
        ('multiple_namespaces',
         dict(opts=[('test', [(None, [opts['foo']])]),
                    ('other', [(None, [opts['bar']])])],
              expected='''[DEFAULT]

#
# From other
#

# bar option (string value)
#bar = <None>

#
# From test
#

# foo option (string value)
#foo = <None>
''')),
        ('group',
         dict(opts=[('test', [(groups['group1'], [opts['foo']])])],
              expected='''[DEFAULT]


[group1]
# Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
# eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim
# ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut
# aliquip ex ea commodo consequat. Duis aute irure dolor in.

#
# From test
#

# foo option (string value)
#foo = <None>
''')),
        ('empty_group',
         dict(opts=[('test', [(groups['group1'], [])])],
              expected='''[DEFAULT]
''')),
        ('multiple_groups',
         dict(opts=[('test', [(groups['group1'], [opts['foo']]),
                              (groups['group2'], [opts['bar']])])],
              expected='''[DEFAULT]


[group1]
# Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
# eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim
# ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut
# aliquip ex ea commodo consequat. Duis aute irure dolor in.

#
# From test
#

# foo option (string value)
#foo = <None>


[group2]

#
# From test
#

# bar option (string value)
#bar = <None>
''')),
        ('group_in_multiple_namespaces',
         dict(opts=[('test', [(groups['group1'], [opts['foo']])]),
                    ('other', [(groups['group1'], [opts['bar']])])],
              expected='''[DEFAULT]


[group1]
# Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
# eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim
# ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut
# aliquip ex ea commodo consequat. Duis aute irure dolor in.

#
# From other
#

# bar option (string value)
#bar = <None>

#
# From test
#

# foo option (string value)
#foo = <None>
''')),
        ('hyphenated_name',
         dict(opts=[('test', [(None, [opts['foo-bar']])])],
              expected='''[DEFAULT]

#
# From test
#

# foobar (string value)
#foo_bar = <None>
''')),
        ('no_help',
         dict(opts=[('test', [(None, [opts['no_help']])])],
              log_warning=('"%s" is missing a help string', 'no_help'),
              expected='''[DEFAULT]

#
# From test
#

# (string value)
#no_help = <None>
''')),
        ('long_help',
         dict(opts=[('test', [(None, [opts['long_help']])])],
              expected='''[DEFAULT]

#
# From test
#

# Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
# eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim
# ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut
# aliquip ex ea commodo consequat. Duis aute irure dolor in
# reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
# pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
# culpa qui officia deserunt mollit anim id est laborum. (string
# value)
#long_help = <None>
''')),
        ('long_help_wrap_at_40',
         dict(opts=[('test', [(None, [opts['long_help']])])],
              wrap_width=40,
              expected='''[DEFAULT]

#
# From test
#

# Lorem ipsum dolor sit amet,
# consectetur adipisicing elit, sed do
# eiusmod tempor incididunt ut labore et
# dolore magna aliqua. Ut enim ad minim
# veniam, quis nostrud exercitation
# ullamco laboris nisi ut aliquip ex ea
# commodo consequat. Duis aute irure
# dolor in reprehenderit in voluptate
# velit esse cillum dolore eu fugiat
# nulla pariatur. Excepteur sint
# occaecat cupidatat non proident, sunt
# in culpa qui officia deserunt mollit
# anim id est laborum. (string value)
#long_help = <None>
''')),
        (
            'long_help_no_wrapping',
            dict(
                opts=[('test', [(None, [opts['long_help']])])],
                wrap_width=0,
                expected='''[DEFAULT]

#
# From test
#

'''

                # noqa
                '# Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod '
                'tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, '
                'quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo '
                'consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse '
                'cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat '
                'non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. '
                '(string value)'
                '''
#long_help = <None>
''')),
        ('long_help_with_preformatting',
         dict(opts=[('test', [(None, [opts['long_help_pre']])])],
              wrap_width=70,
              expected='''[DEFAULT]

#
# From test
#

# This is a very long help text which is preformatted with line
# breaks. It should break when it is too long but also keep the
# specified line breaks. This makes it possible to create lists with
# items:
#
# * item 1
# * item 2
#
# and should increase the readability. (string value)
#long_help_pre = <None>
''')),
        ('choices_opt',
         dict(opts=[('test', [(None, [opts['choices_opt']])])],
              expected='''[DEFAULT]

#
# From test
#

# a string with choices (string value)
# Allowed values: <None>, '', a, b, c
#choices_opt = a
''')),
        ('deprecated opt without deprecated group',
         dict(opts=[('test', [
             (groups['foo'], [opts['deprecated_opt_without_deprecated_group']])
         ])],
              expected='''[DEFAULT]


[foo]
# foo help

#
# From test
#

# deprecated (string value)
# Deprecated group/name - [foo]/foobar
#bar = <None>
''')),
        ('deprecated_for_removal',
         dict(opts=[('test', [(groups['foo'],
                               [opts['deprecated_for_removal_opt']])])],
              expected='''[DEFAULT]


[foo]
# foo help

#
# From test
#

# DEPRECATED: deprecated for removal (string value)
# This option is deprecated for removal.
# Its value may be silently ignored in the future.
#bar = <None>
''')),
        ('deprecated_reason',
         dict(opts=[('test', [(groups['foo'], [opts['deprecated_reason_opt']])
                              ])],
              expected='''[DEFAULT]


[foo]
# foo help

#
# From test
#

# DEPRECATED: Turn off stove (boolean value)
# This option is deprecated for removal.
# Its value may be silently ignored in the future.
# Reason: This was supposed to work but it really, really did not.
# Always buy house insurance.
#turn_off_stove = false
''')),
        ('deprecated_opt_with_deprecated_group',
         dict(opts=[('test', [
             (groups['foo'], [opts['deprecated_opt_with_deprecated_group']])
         ])],
              expected='''[DEFAULT]


[foo]
# foo help

#
# From test
#

# deprecated (string value)
# Deprecated group/name - [group1]/foobar
#bar = <None>
''')),
        ('unknown_type',
         dict(opts=[('test', [(None, [opts['unknown_type']])])],
              expected='''[DEFAULT]

#
# From test
#

# unknown (unknown type)
#unknown_opt = 123
''')),
        ('str_opt',
         dict(opts=[('test', [(None, [opts['str_opt']])])],
              expected='''[DEFAULT]

#
# From test
#

# a string (string value)
#str_opt = foo bar
''')),
        ('str_opt_with_space',
         dict(opts=[('test', [(None, [opts['str_opt_with_space']])])],
              expected='''[DEFAULT]

#
# From test
#

# a string with spaces (string value)
#str_opt = "  foo bar  "
''')),
        ('bool_opt',
         dict(opts=[('test', [(None, [opts['bool_opt']])])],
              expected='''[DEFAULT]

#
# From test
#

# a boolean (boolean value)
#bool_opt = false
''')),
        ('int_opt',
         dict(opts=[('test', [(None, [opts['int_opt']])])],
              expected='''[DEFAULT]

#
# From test
#

# an integer (integer value)
# Minimum value: 1
# Maximum value: 20
#int_opt = 10
''')),
        ('int_opt_min_0',
         dict(opts=[('test', [(None, [opts['int_opt_min_0']])])],
              expected='''[DEFAULT]

#
# From test
#

# an integer (integer value)
# Minimum value: 0
# Maximum value: 20
#int_opt_min_0 = 10
''')),
        ('int_opt_max_0',
         dict(opts=[('test', [(None, [opts['int_opt_max_0']])])],
              expected='''[DEFAULT]

#
# From test
#

# an integer (integer value)
# Maximum value: 0
#int_opt_max_0 = -1
''')),
        ('float_opt',
         dict(opts=[('test', [(None, [opts['float_opt']])])],
              expected='''[DEFAULT]

#
# From test
#

# a float (floating point value)
#float_opt = 0.1
''')),
        ('list_opt',
         dict(opts=[('test', [(None, [opts['list_opt']])])],
              expected='''[DEFAULT]

#
# From test
#

# a list (list value)
#list_opt = 1,2,3
''')),
        ('dict_opt',
         dict(opts=[('test', [(None, [opts['dict_opt']])])],
              expected='''[DEFAULT]

#
# From test
#

# a dict (dict value)
#dict_opt = 1:yes,2:no
''')),
        ('ip_opt',
         dict(opts=[('test', [(None, [opts['ip_opt']])])],
              expected='''[DEFAULT]

#
# From test
#

# an ip address (IP address value)
#ip_opt = 127.0.0.1
''')),
        ('port_opt',
         dict(opts=[('test', [(None, [opts['port_opt']])])],
              expected='''[DEFAULT]

#
# From test
#

# a port (port value)
# Minimum value: 0
# Maximum value: 65535
#port_opt = 80
''')),
        ('hostname_opt',
         dict(opts=[('test', [(None, [opts['hostname_opt']])])],
              expected='''[DEFAULT]

#
# From test
#

# a hostname (hostname value)
#hostname_opt = compute01.nova.site1
''')),
        ('multi_opt',
         dict(opts=[('test', [(None, [opts['multi_opt']])])],
              expected='''[DEFAULT]

#
# From test
#

# multiple strings (multi valued)
#multi_opt = 1
#multi_opt = 2
#multi_opt = 3
''')),
        ('multi_opt_none',
         dict(opts=[('test', [(None, [opts['multi_opt_none']])])],
              expected='''[DEFAULT]

#
# From test
#

# multiple strings (multi valued)
#multi_opt_none =
''')),
        ('multi_opt_empty',
         dict(opts=[('test', [(None, [opts['multi_opt_empty']])])],
              expected='''[DEFAULT]

#
# From test
#

# multiple strings (multi valued)
#multi_opt_empty =
''')),
        ('str_opt_sample_default',
         dict(opts=[('test', [(None, [opts['str_opt_sample_default']])])],
              expected='''[DEFAULT]

#
# From test
#

# a string (string value)
#str_opt = fooishbar
''')),
        ('native_str_type',
         dict(opts=[('test', [(None, [opts['native_str_type']])])],
              expected='''[DEFAULT]

#
# From test
#

# native help (string value)
#native_str_type = <None>
''')),
        ('native_int_type',
         dict(opts=[('test', [(None, [opts['native_int_type']])])],
              expected='''[DEFAULT]

#
# From test
#

# native help (integer value)
#native_int_type = <None>
''')),
        ('native_float_type',
         dict(opts=[('test', [(None, [opts['native_float_type']])])],
              expected='''[DEFAULT]

#
# From test
#

# native help (floating point value)
#native_float_type = <None>
''')),
        ('multi_opt_sample_default',
         dict(opts=[('test', [(None, [opts['multi_opt_sample_default']])])],
              expected='''[DEFAULT]

#
# From test
#

# multiple strings (multi valued)
#multi_opt = 5
#multi_opt = 6
''')),
        ('custom_type_name',
         dict(opts=[('test', [(None, [opts['custom_type_name']])])],
              expected='''[DEFAULT]

#
# From test
#

# this is a port (port number)
#custom_opt_type = 5511
''')),
        ('custom_type',
         dict(opts=[('test', [(None, [opts['custom_type']])])],
              expected='''[DEFAULT]

#
# From test
#

# custom help (unknown value)
#custom_type = <None>
''')),
        ('string_type_with_bad_default',
         dict(opts=[('test', [(None, [opts['string_type_with_bad_default']])])
                    ],
              expected='''[DEFAULT]

#
# From test
#

# string with bad default (string value)
#string_type_with_bad_default = 4096
''')),
        ('str_opt_str_group',
         dict(opts=[('test', [('foo', [opts['str_opt']]),
                              (groups['foo'], [opts['int_opt']])]),
                    ('foo', [('foo', [opts['bool_opt']])])],
              expected='''[DEFAULT]


[foo]
# foo help

#
# From foo
#

# a boolean (boolean value)
#bool_opt = false

#
# From test
#

# a string (string value)
#str_opt = foo bar

#
# From test
#

# an integer (integer value)
# Minimum value: 1
# Maximum value: 20
#int_opt = 10
''')),
        ('opt_str_opt_group',
         dict(opts=[('test', [(groups['foo'], [opts['int_opt']]),
                              ('foo', [opts['str_opt']])]),
                    ('foo', [(groups['foo'], [opts['bool_opt']])])],
              expected='''[DEFAULT]


[foo]
# foo help

#
# From foo
#

# a boolean (boolean value)
#bool_opt = false

#
# From test
#

# an integer (integer value)
# Minimum value: 1
# Maximum value: 20
#int_opt = 10

#
# From test
#

# a string (string value)
#str_opt = foo bar
''')),
        ('opt_with_DeprecatedOpt',
         dict(opts=[('test', [(None, [opts['opt_with_DeprecatedOpt']])])],
              expected='''[DEFAULT]

#
# From test
#

# Opt with DeprecatedOpt (boolean value)
# Deprecated group/name - [deprecated]/foo_bar
#foo_bar = <None>
''')),
    ]

    output_file_scenarios = [
        ('stdout', dict(stdout=True, output_file=None)),
        ('output_file', dict(output_file='sample.conf', stdout=False)),
    ]

    @classmethod
    def generate_scenarios(cls):
        cls.scenarios = testscenarios.multiply_scenarios(
            cls.content_scenarios, cls.output_file_scenarios)

    def setUp(self):
        super(GeneratorTestCase, self).setUp()

        self.conf = cfg.ConfigOpts()
        self.config_fixture = config_fixture.Config(self.conf)
        self.config = self.config_fixture.config
        self.useFixture(self.config_fixture)

        self.tempdir = self.useFixture(fixtures.TempDir())

    def _capture_stream(self, stream_name):
        self.useFixture(
            fixtures.MonkeyPatch("sys.%s" % stream_name, moves.StringIO()))
        return getattr(sys, stream_name)

    def _capture_stdout(self):
        return self._capture_stream('stdout')

    @mock.patch.object(generator, '_get_raw_opts_loaders')
    @mock.patch.object(generator, 'LOG')
    def test_generate(self, mock_log, raw_opts_loader):
        generator.register_cli_opts(self.conf)

        namespaces = [i[0] for i in self.opts]
        self.config(namespace=namespaces)

        for group in self.groups.values():
            self.conf.register_group(group)

        wrap_width = getattr(self, 'wrap_width', None)
        if wrap_width is not None:
            self.config(wrap_width=wrap_width)

        if self.stdout:
            stdout = self._capture_stdout()
        else:
            output_file = self.tempdir.join(self.output_file)
            self.config(output_file=output_file)

        # We have a static data structure matching what should be
        # returned by _list_opts() but we're mocking out a lower level
        # function that needs to return a namespace and a callable to
        # return options from that namespace. We have to pass opts to
        # the lambda to cache a reference to the name because the list
        # comprehension changes the thing pointed to by the name each
        # time through the loop.
        raw_opts_loader.return_value = [(ns, lambda opts=opts: opts)
                                        for ns, opts in self.opts]

        generator.generate(self.conf)

        if self.stdout:
            self.assertEqual(self.expected, stdout.getvalue())
        else:
            with open(output_file, 'r') as f:
                actual = f.read()
            self.assertEqual(self.expected, actual)

        log_warning = getattr(self, 'log_warning', None)
        if log_warning is not None:
            mock_log.warning.assert_called_once_with(*log_warning)
        else:
            self.assertFalse(mock_log.warning.called)
Пример #24
0
    cfg.URIOpt('html5_proxy_base_url',
               schemes=['http', 'https'],
               default='http://127.0.0.1:6083/',
               help="""
The URL an end user would use to connect to the RDP HTML5 console proxy.
The console proxy service is called with this token-embedded URL and
establishes the connection to the proper instance.

An RDP HTML5 console proxy service will need to be configured to listen on the
address configured here. Typically the console proxy service would be run on a
controller node. The localhost address used as default would only work in a
single node environment i.e. devstack.

An RDP HTML5 proxy allows a user to access via the web the text or graphical
console of any Windows server or workstation using RDP. RDP HTML5 console
proxy services include FreeRDP, wsgate.
See https://github.com/FreeRDP/FreeRDP-WebConnect

Possible values:

* <scheme>://<ip-address>:<port-number>/

  The scheme must be identical to the scheme configured for the RDP HTML5
  console proxy service. It is ``http`` or ``https``.

  The IP address must be identical to the address on which the RDP HTML5
  console proxy service is listening.

  The port must be identical to the port on which the RDP HTML5 console proxy
  service is listening.

Related options:

* ``rdp.enabled``: Must be set to ``True`` for ``html5_proxy_base_url`` to be
  effective.
"""),
Пример #25
0
            default=100,
            min=3,
            help=_('The size of the workers greenthread pool. '
                   'Note that 2 threads will be reserved by the conductor '
                   'itself for handling heart beats and periodic tasks. '
                   'On top of that, `sync_power_state_workers` will take '
                   'up to 7 green threads with the default value of 8.')),
 cfg.IntOpt('heartbeat_interval',
            default=10,
            help=_('Seconds between conductor heart beats.')),
 cfg.URIOpt('api_url',
            schemes=('http', 'https'),
            deprecated_for_removal=True,
            deprecated_reason=_("Use [service_catalog]endpoint_override "
                                "option instead if required to use "
                                "a specific ironic api address, "
                                "for example in noauth mode."),
            help=_('URL of Ironic API service. If not set ironic can '
                   'get the current value from the keystone service '
                   'catalog. If set, the value must start with either '
                   'http:// or https://.')),
 cfg.IntOpt(
     'heartbeat_timeout',
     default=60,
     # We're using timedelta which can overflow if somebody sets this
     # too high, so limit to a sane value of 10 years.
     max=315576000,
     help=_('Maximum time (in seconds) since the last check-in '
            'of a conductor. A conductor is considered inactive '
            'when this time has been exceeded.')),
 cfg.IntOpt('sync_power_state_interval',
Пример #26
0
The VNC proxy is an OpenStack component that enables compute service
users to access their instances through VNC clients.

This option sets the private address to which proxy clients, such as
``nova-xvpvncproxy``, should connect to.
"""),
    cfg.URIOpt('novncproxy_base_url',
               default='http://127.0.0.1:6080/vnc_auto.html',
               deprecated_group='DEFAULT',
               help="""
Public address of noVNC VNC console proxy.

The VNC proxy is an OpenStack component that enables compute service
users to access their instances through VNC clients. noVNC provides
VNC support through a websocket-based client.

This option sets the public base URL to which client systems will
connect. noVNC clients can use this address to connect to the noVNC
instance and, by extension, the VNC sessions.

Related options:

* novncproxy_host
* novncproxy_port
"""),
    cfg.HostAddressOpt('xvpvncproxy_host',
                       default='0.0.0.0',
                       deprecated_group='DEFAULT',
                       help="""
IP address or hostname that the XVP VNC console proxy should bind to.
Пример #27
0
users to access their instances through VNC clients.

This option sets the private address to which proxy clients, such as
``nova-novncproxy``, should connect to.
"""),
    cfg.URIOpt('novncproxy_base_url',
               default='http://127.0.0.1:6080/vnc_auto.html',
               deprecated_group='DEFAULT',
               help="""
Public address of noVNC VNC console proxy.

The VNC proxy is an OpenStack component that enables compute service
users to access their instances through VNC clients. noVNC provides
VNC support through a websocket-based client.

This option sets the public base URL to which client systems will
connect. noVNC clients can use this address to connect to the noVNC
instance and, by extension, the VNC sessions.

If using noVNC >= 1.0.0, you should use ``vnc_lite.html`` instead of
``vnc_auto.html``.

Related options:

* novncproxy_host
* novncproxy_port
"""),
    cfg.HostAddressOpt('xvpvncproxy_host',
                       default='0.0.0.0',
                       deprecated_group='DEFAULT',
                       deprecated_for_removal=True,
                       deprecated_since='19.0.0',
Пример #28
0
#
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#    License for the specific language governing permissions and limitations
#    under the License.

from oslo_config import cfg

from ironic.common.i18n import _
from ironic.conf import auth

opts = [
    cfg.URIOpt('url',
               schemes=('http', 'https'),
               help=_('URL for connecting to cinder. If set, the value must '
                      'start with either http:// or https://. This option is '
                      'part of boot-from-volume work, which is not currently '
                      'exposed to users.')),
    cfg.IntOpt('retries',
               default=3,
               help=_('Client retries in the case of a failed request '
                      'connection. This option is part of boot-from-volume '
                      'work, which is not currently exposed to users.')),
    cfg.IntOpt('action_retries',
               default=3,
               help=_('Number of retries in the case of a failed '
                      'action (currently only used when detaching '
                      'volumes). This option is part of boot-from-volume '
                      'work, which is not currently exposed to users.')),
    cfg.IntOpt('action_retry_interval',
               default=5,
Пример #29
0
def main():
    # FIXME: Split these up into separate components?
    #   host, port, username, password, database
    cli_opts = [
        cfg.SubCommandOpt('command',
                          title="Commands",
                          help="Available commands",
                          handler=add_subcommands),
        cfg.URIOpt('source',
                   required=False,
                   help='connection URL to the src DB server'),
        cfg.URIOpt('target',
                   required=False,
                   help='connection URL to the target server'),
        cfg.StrOpt('batch',
                   required=False,
                   help='YAML file containing connection URLs'),
        cfg.BoolOpt('exclude-deleted',
                    default=True,
                    help='Exclude table rows marked as deleted. '
                    'True by default.'),
        cfg.IntOpt('chunk-size',
                   default=10000,
                   min=0,
                   help='Number of records to move per chunk. Set to 0 to '
                   'disable, default is 10,000.')
    ]

    cfg.CONF.register_cli_opts(cli_opts)
    logging.register_options(cfg.CONF)
    logging.set_defaults()

    # read config and initialize logging
    cfg.CONF(project='psql2mysql')
    #    cfg.CONF.set_override("use_stderr", True)

    logging.setup(cfg.CONF, 'psql2mysql')

    # We expect batch file with this syntax:
    #
    # keystone:
    #   source: postgresql://keystone:[email protected]/keystone
    #   target: mysql+pymysql://keystone:[email protected]/keystone?charset=utf8
    # cinder:
    #   source: postgresql://cinder:[email protected]/cinder
    #   target:
    if cfg.CONF.batch:
        try:
            with open(cfg.CONF.batch, 'r') as f:
                for db_name, db in yaml.load(f).iteritems():
                    print('Processing database "%s"... ' % db_name)
                    check_source_schema(db['source'])
                    if db['target']:
                        check_target_schema(db['target'])
                    cfg.CONF.command.func(cfg, db['source'], db['target'])

        except Psql2MysqlRuntimeError as e:
            print(e, file=sys.stderr)
            sys.exit(1)
        except IOError:
            print('Batch file "%s" does not exist or cannot be read' %
                  cfg.CONF.batch)
            sys.exit(2)

        print("Batch processing done.")
        sys.exit(0)

    check_source_schema(cfg.CONF.source)

    if cfg.CONF.target:
        check_target_schema(cfg.CONF.target)

    try:
        cfg.CONF.command.func(cfg, cfg.CONF.source, cfg.CONF.target)
    except Psql2MysqlRuntimeError as e:
        print(e, file=sys.stderr)
        sys.exit(1)
Пример #30
0
                item_type=cfg.types.URI(schemes=['http', 'https']),
                default=[],
                help=_("List of device urls to be synced by the agent")),
    cfg.BoolOpt('https_verify', default=False,
                help=_("Verify https endpoint")),
    cfg.BoolOpt('prometheus',
                default=True,
                help=_("Enable prometheus metrics exporter"))
]

F5_VMCP_OPTS = [
    cfg.StrOpt('interface',
               default='portchannel1',
               help=_("Interface to bind vlans on VCMP host")),
    cfg.URIOpt('host',
               schemes=['http', 'https'],
               default=None,
               help=_("VCMP host that need vlan configured for this guest")),
    cfg.StrOpt('guest',
               default=None,
               help=_("VCMP guest name to identify the associated guest")),
]


def list_opts():
    return [('agent', agent_config.AGENT_STATE_OPTS)]


def register_f5_opts(conf):
    conf.register_opts(F5_OPTS, 'F5')
    conf.register_opts(F5_VMCP_OPTS, 'F5_VCMP')