141
141
authurl = "https://%s" % '/'.join(path_parts)
143
143
return user, key, authurl, container, obj
146
def add_options(parser):
148
Adds any configuration options that each store might
151
:param parser: An optparse.OptionParser object
154
# TODO(jaypipes): Remove these imports...
155
from glance.store.http import HTTPBackend
156
from glance.store.s3 import S3Backend
157
from glance.store.swift import SwiftBackend
158
from glance.store.filesystem import FilesystemBackend
160
help_text = "The following configuration options are specific to the "\
161
"Glance image store."
163
DEFAULT_STORE_CHOICES = ['file', 'swift', 's3']
164
group = optparse.OptionGroup(parser, "Image Store Options", help_text)
165
group.add_option('--default-store', metavar="STORE",
167
choices=DEFAULT_STORE_CHOICES,
168
help="The backend store that Glance will use to store "
169
"virtual machine images to. Choices: ('%s') "
170
"Default: %%default" % "','".join(DEFAULT_STORE_CHOICES))
172
backend_classes = [FilesystemBackend,
176
for backend_class in backend_classes:
177
if hasattr(backend_class, 'add_options'):
178
backend_class.add_options(group)
180
parser.add_option_group(group)