def delete_user_by_name(self, name, host='%'): with mysql_util.SqlClient(self.mysql_app.get_engine(), use_flush=True) as client: du = sql_query.DropUser(name, host=host) t = text(str(du)) LOG.debug("delete_user_by_name: %s", t) client.execute(t)
def delete_user(self, user): """Delete the specified users""" with LocalSqlClient(get_engine()) as client: mysql_user = models.MySQLUser() mysql_user.deserialize(user) du = sql_query.DropUser(mysql_user.name, host=mysql_user.host) t = text(str(du)) client.execute(t)
def delete_user_by_name(self, name, host='%'): with self.local_sql_client(self.mysql_app.get_engine()) as client: du = sql_query.DropUser(name, host=host) t = text(str(du)) LOG.debug("delete_user_by_name: %s", t) client.execute(t)
def test_defaults(self): username = '******' hostname = 'localhost' du = sql_query.DropUser(user=username, host=hostname) self.assertEqual("DROP USER `root`@`localhost`;", str(du))