Skip to content

Commit

Permalink
move code
Browse files Browse the repository at this point in the history
  • Loading branch information
wayyoungboy committed Dec 11, 2024
1 parent 588cc7d commit cd6c686
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions rpm/oceanbase-diagnostic-tool.spec
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,17 @@ DATE=`date`
VERSION="$RPM_PACKAGE_VERSION"

cd $SRC_DIR
cd src
pwd
pip install -r requirements3.txt
cp -f main.py obdiag.py
cp -f src/main.py src/obdiag.py
sed -i "s/<B_TIME>/$DATE/" ./common/version.py && sed -i "s/<VERSION>/$VERSION/" ./common/version.py
mkdir -p $BUILD_DIR/SOURCES ${RPM_BUILD_ROOT}
mkdir -p $BUILD_DIR/SOURCES/site-packages
mkdir -p $BUILD_DIR/SOURCES/resources
mkdir -p $BUILD_DIR/SOURCES/dependencies/bin
mkdir -p ${RPM_BUILD_ROOT}/usr/bin
mkdir -p ${RPM_BUILD_ROOT}/usr/local/oceanbase-diagnostic-tool
cd src
pyinstaller --hidden-import=decimal -p $BUILD_DIR/SOURCES/site-packages -F obdiag.py
rm -f obdiag.py oceanbase-diagnostic-tool.spec

Expand Down
5 changes: 2 additions & 3 deletions src/handler/analyzer/analyze_queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import csv
from tabulate import tabulate
from src.common.command import get_observer_version_by_sql
from src.common.ssh_client.local_client import LocalClient
from src.handler.base_shell_handler import BaseShellHandler
from src.common.obdiag_exception import OBDIAGFormatException, OBDIAGDBConnException
from src.common.constant import const
Expand All @@ -31,9 +32,7 @@
from src.common.tool import DirectoryUtil
from src.common.tool import FileUtil
from src.common.tool import TimeUtils
from src import common as ssh_client_local_client
from src.common.result_type import ObdiagResult

from src.common.ob_connector import OBConnector
import re

Expand Down Expand Up @@ -342,7 +341,7 @@ def __pharse_offline_log_file(self, ssh_client, log_name, local_store_dir):
:return:
"""

ssh_client = ssh_client_local_client.LocalClient(context=self.context, node={"ssh_type": "local"})
ssh_client = LocalClient(context=self.context, node={"ssh_type": "local"})
local_store_path = "{0}/{1}".format(local_store_dir, str(log_name).strip(".").replace("/", "_"))
grep_cmd = "grep -e 'dump tenant info(tenant={id:{tenant_id},' {log_name} >> {local_store_path} ".format(tenant_id=self.tenant_id, log_name=log_name, local_store_path=local_store_path)
self.stdio.verbose("grep files, run cmd = [{0}]".format(grep_cmd))
Expand Down

0 comments on commit cd6c686

Please sign in to comment.