コード例 #1
0
ファイル: mysql_service.py プロジェクト: DJohnstone/trove
    def _write_mycnf(self, update_memory_mb, admin_password):
        """
        Install the set of mysql my.cnf templates from dbaas-mycnf package.
        The package generates a template suited for the current
        container flavor. Update the os_admin user and password
        to the my.cnf file for direct login from localhost
        """
        LOG.info(_("Writing my.cnf templates."))
        if admin_password is None:
            admin_password = get_auth_password()

        # As of right here, the admin_password contains the password to be
        # applied to the my.cnf file, whether it was there before (and we
        # passed it in) or we generated a new one just now (because we didn't
        # find it).

        LOG.debug(_("Installing my.cnf templates"))
        pkg.pkg_install("dbaas-mycnf", self.TIME_OUT)

        LOG.info(_("Replacing my.cnf with template."))
        template_path = DBAAS_MYCNF % update_memory_mb
        # replace my.cnf with template.
        self._replace_mycnf_with_template(template_path, ORIG_MYCNF)

        LOG.info(_("Writing new temp my.cnf."))
        self._write_temp_mycnf_with_admin_account(ORIG_MYCNF, TMP_MYCNF,
                                                  admin_password)
        # permissions work-around
        LOG.info(_("Moving tmp into final."))
        utils.execute_with_timeout("sudo", "mv", TMP_MYCNF, FINAL_MYCNF)
        LOG.info(_("Removing original my.cnf."))
        utils.execute_with_timeout("sudo", "rm", ORIG_MYCNF)
        LOG.info(_("Symlinking final my.cnf."))
        utils.execute_with_timeout("sudo", "ln", "-s", FINAL_MYCNF, ORIG_MYCNF)
        self.wipe_ib_logfiles()
コード例 #2
0
ファイル: mysql_service.py プロジェクト: riddhi89/reddwarf
    def _write_mycnf(self, update_memory_mb, admin_password):
        """
        Install the set of mysql my.cnf templates from dbaas-mycnf package.
        The package generates a template suited for the current
        container flavor. Update the os_admin user and password
        to the my.cnf file for direct login from localhost
        """
        LOG.info(_("Writing my.cnf templates."))
        if admin_password is None:
            admin_password = get_auth_password()

        # As of right here, the admin_password contains the password to be
        # applied to the my.cnf file, whether it was there before (and we
        # passed it in) or we generated a new one just now (because we didn't
        # find it).

        LOG.debug(_("Installing my.cnf templates"))
        pkg.pkg_install("dbaas-mycnf", self.TIME_OUT)

        LOG.info(_("Replacing my.cnf with template."))
        template_path = DBAAS_MYCNF % update_memory_mb
        # replace my.cnf with template.
        self._replace_mycnf_with_template(template_path, ORIG_MYCNF)

        LOG.info(_("Writing new temp my.cnf."))
        self._write_temp_mycnf_with_admin_account(ORIG_MYCNF, TMP_MYCNF,
                                                  admin_password)
        # permissions work-around
        LOG.info(_("Moving tmp into final."))
        utils.execute_with_timeout("sudo", "mv", TMP_MYCNF, FINAL_MYCNF)
        LOG.info(_("Removing original my.cnf."))
        utils.execute_with_timeout("sudo", "rm", ORIG_MYCNF)
        LOG.info(_("Symlinking final my.cnf."))
        utils.execute_with_timeout("sudo", "ln", "-s", FINAL_MYCNF, ORIG_MYCNF)
        self.wipe_ib_logfiles()
コード例 #3
0
ファイル: dbaas.py プロジェクト: cp16net/reddwarf-1
 def _install_mysql(self):
     """Install mysql server. The current version is 5.1"""
     LOG.debug(_("Installing mysql server"))
     pkg.pkg_install(self.MYSQL_PACKAGE_VERSION, self.TIME_OUT)
     LOG.debug(_("Finished installing mysql server"))
コード例 #4
0
ファイル: test_pkg.py プロジェクト: DJohnstone/trove
 def test_already_instaled(self):
     # test happy path
     pexpect.spawn.expect = Mock(return_value=6)
     pkg.pkg_install(self.pkgName, 5000)
コード例 #5
0
ファイル: test_pkg.py プロジェクト: DJohnstone/trove
 def test_success_install(self):
     # test
     pexpect.spawn.expect = Mock(return_value=5)
     self.assertTrue(pkg.pkg_install(self.pkgName, 5000) is None)
コード例 #6
0
 def _install_mysql(self):
     """Install mysql server. The current version is 5.5"""
     LOG.debug(_("Installing mysql server"))
     pkg.pkg_install(self.MYSQL_PACKAGE_VERSION, self.TIME_OUT)
     LOG.debug(_("Finished installing mysql server"))
コード例 #7
0
 def test_already_instaled(self):
     # test happy path
     pexpect.spawn.expect = Mock(return_value=6)
     pkg.pkg_install(self.pkgName, 5000)
コード例 #8
0
 def test_success_install(self):
     # test
     pexpect.spawn.expect = Mock(return_value=5)
     self.assertTrue(pkg.pkg_install(self.pkgName, 5000) is None)