Rename glance to glare

This commit renames glance options to glare, to avoid confusion. It also
deprecates 'glance' group for glare opts.
According to Iced3c68010eb6bcd2a6a1ec8f1c6883f84cbe77f new endpoint is
going to be artifact, this commit reflects that.

Partial-Bug: #1550427
Change-Id: Ie4ac8cc6d31090fcad557201e319848bb4639477
This commit is contained in:
Kirill Zaitsev 2016-02-26 20:30:48 +03:00
parent 1f24d31492
commit 8cb5b6b10f
3 changed files with 31 additions and 20 deletions

View File

@ -234,30 +234,36 @@ packages_opts = [
cfg.StrOpt('packages_service', default='murano',
help=_('The service to store murano packages: murano (stands '
'for legacy behavior using murano-api) or glance '
'(stands for Glance V3 artifact repository)'))
'(stands for glance-glare artifact service)'))
]
glance_opts = [
cfg.StrOpt('url', help='Optional murano url in format '
'like http://0.0.0.0:9292 used by Glance API'),
glare_opts = [
cfg.StrOpt('url', help='Optional glare url in format '
'like http://0.0.0.0:9494 used by Glare API',
deprecated_group='glance'),
cfg.BoolOpt('insecure', default=False,
help='This option explicitly allows Murano to perform '
'"insecure" SSL connections and transfers with Glance API.'),
'"insecure" SSL connections and transfers with Glare API.',
deprecated_group='glance'),
cfg.StrOpt('ca_file',
help='(SSL) Tells Murano to use the specified certificate file '
'to verify the peer running Glance API.'),
'to verify the peer running Glare API.',
deprecated_group='glance'),
cfg.StrOpt('cert_file',
help='(SSL) Tells Murano to use the specified client '
'certificate file when communicating with Glance.'),
'certificate file when communicating with Glare.',
deprecated_group='glance'),
cfg.StrOpt('key_file', help='(SSL/SSH) Private key file name to '
'communicate with Glance API.'),
'communicate with Glare API.',
deprecated_group='glance'),
cfg.StrOpt('endpoint_type', default='publicURL',
help='Glance endpoint type.')
help='Glare endpoint type.',
deprecated_group='glance')
]
file_server = [
@ -285,7 +291,7 @@ CONF.register_cli_opts(metadata_dir)
CONF.register_opts(packages_opts, group='packages_opts')
CONF.register_opts(stats_opts, group='stats')
CONF.register_opts(networking_opts, group='networking')
CONF.register_opts(glance_opts, group='glance')
CONF.register_opts(glare_opts, group='glare')
def parse_args(args=None, usage=None, default_config_files=None):

View File

@ -28,6 +28,7 @@ from muranoclient.glance import client as glare_client
import muranoclient.v1.client as muranoclient
from oslo_config import cfg
from oslo_log import log as logging
from oslo_log import versionutils
import six
from murano.common import auth_utils
@ -67,7 +68,7 @@ class ApiPackageLoader(package_loader.MuranoPackageLoader):
self._downloaded = []
def _get_glare_client(self):
glance_settings = CONF.glance
glare_settings = CONF.glare
session = auth_utils.get_client_session(self._execution_session)
token = session.auth.get_token(session)
if self._last_glare_token != token:
@ -75,19 +76,19 @@ class ApiPackageLoader(package_loader.MuranoPackageLoader):
self._glare_client = None
if self._glare_client is None:
url = glance_settings.url
url = glare_settings.url
if not url:
url = session.get_endpoint(
service_type='image',
interface=glance_settings.endpoint_type,
service_type='artifact',
interface=glare_settings.endpoint_type,
region_name=CONF.home_region)
self._glare_client = glare_client.Client(
endpoint=url, token=token,
insecure=glance_settings.insecure,
key_file=glance_settings.key_file or None,
ca_file=glance_settings.ca_file or None,
cert_file=glance_settings.cert_file or None,
insecure=glare_settings.insecure,
key_file=glare_settings.key_file or None,
ca_file=glare_settings.ca_file or None,
cert_file=glare_settings.cert_file or None,
type_name='murano',
type_version=1)
return self._glare_client
@ -96,7 +97,11 @@ class ApiPackageLoader(package_loader.MuranoPackageLoader):
def client(self):
murano_settings = CONF.murano
last_glare_client = self._glare_client
if CONF.packages_opts.packages_service == 'glance':
if CONF.packages_opts.packages_service in ['glance', 'glare']:
if CONF.packages_opts.packages_service == 'glance':
versionutils.report_deprecated_feature(
LOG, _("'glance' packages_service option has been renamed "
"to 'glare', please update your configuration"))
artifacts_client = self._get_glare_client()
else:
artifacts_client = None

View File

@ -35,7 +35,7 @@ _opt_lists = [
('heat', murano.common.config.heat_opts),
('neutron', murano.common.config.neutron_opts),
('murano', murano.common.config.murano_opts),
('glance', murano.common.config.glance_opts),
('glare', murano.common.config.glare_opts),
('mistral', murano.common.config.mistral_opts),
('networking', murano.common.config.networking_opts),
('stats', murano.common.config.stats_opts),