def install(bundle): if not os.path.isfile("/usr/share/clear/bundles/" + str(bundle)) and \ not os.path.isfile("/usr/share/clear/bundles/" "openstack-all-in-one"): LOG.info("Installing {0} bundle".format(bundle)) cmd = "clr_bundle_add -V {0}".format(bundle) if(os.path.isfile("/bin/swupd")): cmd = "swupd bundle-add -V {0}".format(bundle) try: stdout, stderr = util.run_command(cmd) if stderr: LOG.error("swupd bundle-add: {0}\n{1}" .format(stdout, stderr)) except Exception: LOG.error("clearstack: cannot install" " {0} bundle".format(bundle))
# 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 common.util import LOG from common import util from modules.conf import CONF from modules.mariadb import MariaDB conf = CONF mariadb = MariaDB.get() mariadb_user = CONF["CONFIG_MARIADB_USER"] mariadb_pw = CONF["CONFIG_MARIADB_PW"] if util.str2bool(conf['CONFIG_MARIADB_INSTALL']): mariadb.install() mariadb.configure() mariadb.start_server() mariadb.secure_installation(mariadb_user, mariadb_pw) databases = ['keystone', 'glance', 'nova', 'neutron', 'heat', 'sahara'] for database in databases: if database == 'keystone' or util.str2bool(conf['CONFIG_%s_INSTALL' % database.upper()]): LOG.info("Setting up mariadb for %s" % database) password = CONF['CONFIG_%s_DB_PW' % database.upper()] mariadb.setup_database(database, database, password)