@@ -53,6 +53,23 @@ def initConfig(controller):
5353 "USE_DEFAULT" : False ,
5454 "NEED_CONFIRM" : True ,
5555 "CONDITION" : False },
56+
57+ {"CMD_OPTION" : "glance-backend" ,
58+ "USAGE" : ("Glance storage backend controls how Glance stores disk "
59+ "images. Supported values: file, swift. Note that Swift "
60+ "installation have to be enabled to have swift backend "
61+ "working. Otherwise Packstack will fallback to 'file'." ),
62+ "PROMPT" : "Glance storage backend" ,
63+ "OPTION_LIST" : ["file" , "swift" ],
64+ "VALIDATORS" : [validators .validate_options ],
65+ "PROCESSORS" : [process_backend ],
66+ "DEFAULT_VALUE" : "file" ,
67+ "MASK_INPUT" : False ,
68+ "LOOSE_VALIDATION" : False ,
69+ "CONF_NAME" : "CONFIG_GLANCE_BACKEND" ,
70+ "USE_DEFAULT" : False ,
71+ "NEED_CONFIRM" : False ,
72+ "CONDITION" : False },
5673 ]
5774 group = {"GROUP_NAME" : "GLANCE" ,
5875 "DESCRIPTION" : "Glance Config parameters" ,
@@ -80,6 +97,14 @@ def initSequences(controller):
8097 controller .addSequence ("Installing OpenStack Glance" , [], [], glancesteps )
8198
8299
100+ #------------------------- helper functions -------------------------
101+
102+ def process_backend (value , param_name , config ):
103+ if value == 'swift' and config ['CONFIG_SWIFT_INSTALL' ] != 'y' :
104+ return 'file'
105+ return value
106+
107+
83108#-------------------------- step functions --------------------------
84109
85110def create_keystone_manifest (config , messages ):
@@ -101,6 +126,9 @@ def create_manifest(config, messages):
101126 mq_template = get_mq (config , "glance_ceilometer" )
102127 manifestdata += getManifestTemplate (mq_template )
103128
129+ manifestdata += getManifestTemplate (
130+ 'glance_%s.pp' % config ['CONFIG_GLANCE_BACKEND' ])
131+
104132 config ['FIREWALL_SERVICE_NAME' ] = "glance"
105133 config ['FIREWALL_PORTS' ] = "'9292'"
106134 config ['FIREWALL_CHAIN' ] = "INPUT"
0 commit comments