def post_start(self): comp.PythonRuntime.post_start(self) if self.do_upload: # Install any images that need activating... LOG.info("Waiting %s seconds so that glance can start up before image install." % (self.wait_time)) sh.sleep(self.wait_time) params = {} params['glance'] = ghelper.get_shared_params(self.cfg) params['keystone'] = khelper.get_shared_params(self.cfg, 'glance') ghelper.UploadService(params).install(self._get_image_urls())
def _config_adjust_registry(self, contents, fn): params = ghelper.get_shared_params(self.cfg) with io.BytesIO(contents) as stream: config = cfg.RewritableConfigParser() config.readfp(stream) config.set('DEFAULT', 'debug', True) config.set('DEFAULT', 'verbose', True) config.set('DEFAULT', 'bind_port', params['endpoints']['registry']['port']) config.set('DEFAULT', 'sql_connection', dbhelper.fetch_dbdsn(self.cfg, DB_NAME, utf8=True)) config.remove_option('DEFAULT', 'log_file') config.set('paste_deploy', 'flavor', 'keystone') return config.stringify(fn) return contents
def post_start(self): if not sh.isfile(self.init_fn): LOG.info("Waiting %s seconds so that keystone can start up before running first time init." % (self.wait_time)) sh.sleep(self.wait_time) LOG.info("Running commands to initialize keystone.") LOG.debug("Initializing with %s", self.init_what) initial_cfg = dict() initial_cfg['glance'] = ghelper.get_shared_params(self.cfg) initial_cfg['keystone'] = khelper.get_shared_params(self.cfg) initial_cfg['nova'] = nhelper.get_shared_params(self.cfg) initial_cfg['quantum'] = qhelper.get_shared_params(self.cfg) initial_cfg['swift'] = shelper.get_shared_params(self.cfg) init_what = utils.param_replace_deep(copy.deepcopy(self.init_what), initial_cfg) khelper.Initializer(initial_cfg['keystone']).initialize(**init_what) # Writing this makes sure that we don't init again sh.write_file(self.init_fn, utils.prettify_yaml(init_what)) LOG.info("If you wish to re-run initialization, delete %s", colorizer.quote(self.init_fn))
def _config_adjust_api(self, contents, fn): params = ghelper.get_shared_params(self.cfg) with io.BytesIO(contents) as stream: config = cfg.RewritableConfigParser() config.readfp(stream) img_store_dir = sh.joinpths(self.get_option('component_dir'), 'images') config.set('DEFAULT', 'debug', True) config.set('DEFAULT', 'verbose', True) config.set('DEFAULT', 'default_store', 'file') config.set('DEFAULT', 'filesystem_store_datadir', img_store_dir) config.set('DEFAULT', 'bind_port', params['endpoints']['public']['port']) config.set('DEFAULT', 'sql_connection', dbhelper.fetch_dbdsn(self.cfg, DB_NAME, utf8=True)) config.remove_option('DEFAULT', 'log_file') config.set('paste_deploy', 'flavor', 'keystone') LOG.info("Ensuring file system store directory %r exists and is empty." % (img_store_dir)) sh.deldir(img_store_dir) self.tracewriter.dirs_made(*sh.mkdirslist(img_store_dir)) return config.stringify(fn)