diff --git a/core.py b/core.py index 3a866683917eede933bba9c47dd9d045c1260291..2c335ab0eb91c74fdca23ae1f80a7df31beb6b1f 100644 --- a/core.py +++ b/core.py @@ -1215,9 +1215,9 @@ class ObdHome(object): self._call_stdio('error', 'Deploy "%s" is %s. You could not reload an %s cluster.' % (name, deploy_info.status.value, deploy_info.status.value)) return False - # if deploy_info.config_status != DeployConfigStatus.NEED_RELOAD: - # self._call_stdio('error', 'Deploy config %s' % deploy_info.config_status.value) - # return False + if deploy_info.config_status == DeployConfigStatus.UNCHNAGE: + self._call_stdio('print', 'Deploy config is UNCHNAGE') + return True self._call_stdio('verbose', 'Get deploy config') deploy_config = deploy.deploy_config @@ -1542,9 +1542,9 @@ class ObdHome(object): self._call_stdio('error', 'Not found %s in Deploy "%s" ' % (component, name)) return False else: - if len(deploy_info.components) == 1: - component = deploy_info.components.keys()[0] - else: + for component in deploy_info.components: + break + if not component: self._call_stdio('error', 'Specify the components you want to upgrade.') return False diff --git a/plugins/oceanbase/3.1.0/upgrade_route.py b/plugins/oceanbase/3.1.0/upgrade_route.py index 82461c0e8d833d61e7bcaf3f2f4b5f0afb20033c..a187a056147f2d85b375f7856962487c6c6f59c1 100644 --- a/plugins/oceanbase/3.1.0/upgrade_route.py +++ b/plugins/oceanbase/3.1.0/upgrade_route.py @@ -186,7 +186,7 @@ def upgrade_route(plugin_context, current_repository, dest_repository, *args, ** yaml = YamlLoader(stdio) try: - with open(upgrade_dep_path) as f: + with open(upgrade_dep_path, encoding='utf-8') as f: data = yaml.load(f) graph = ObVersionGraph(data) route = graph.findShortestUpgradePath(current_repository, dest_repository) diff --git a/rpm/build.sh b/rpm/build.sh index 1938197821978cb405fb21d24d39d2e04a048207..9c55212e9fa7af7d67c133eaa98e02193186ada0 100755 --- a/rpm/build.sh +++ b/rpm/build.sh @@ -108,15 +108,16 @@ function build() CID=`git log |head -n1 | awk -F' ' '{print $2}'` BRANCH=`git branch | grep -e "^\*" | awk -F' ' '{print $2}'` DATE=`date '+%b %d %Y %H:%M:%S'` + VERSION=$VERSION".`date +%s`"` BUILD_DIR="$DIR/.build" rm -fr $BUILD_DIR mkdir -p $BUILD_DIR/lib/site-packages mkdir -p $BUILD_DIR/mirror/remote wget https://mirrors.aliyun.com/oceanbase/OceanBase.repo -O $BUILD_DIR/mirror/remote/OceanBase.repo cat _cmd.py | sed "s//$CID/" | sed "s//$BRANCH/" | sed "s//$DATE/" | sed "s//$OBD_DUBUG/" | sed "s//$VERSION/" > obd.py - pip install -r $req_fn.txt - pip install -r plugins-$req_fn.txt --target=$BUILD_DIR/lib/site-packages - pyinstaller --hidden-import=decimal --hidden-import=configparser -F obd.py + pip install -r $req_fn.txt | exit 1 + pip install -r plugins-$req_fn.txt --target=$BUILD_DIR/lib/site-packages | exit 1 + pyinstaller --hidden-import=decimal --hidden-import=configparser -F obd.py | exit 1 rm -f obd.py obd.spec cp -r plugins $BUILD_DIR/plugins rm -fr /usr/obd /usr/bin/obd diff --git a/rpm/ob-deploy.spec b/rpm/ob-deploy.spec index 5e08e82e29e27832471f9589e88a8a4b1573cc0a..e5d877f8eaca9bc75753d448bef9978b63b51216 100644 --- a/rpm/ob-deploy.spec +++ b/rpm/ob-deploy.spec @@ -1,5 +1,5 @@ Name: ob-deploy -Version: 1.2.0 +Version: 1.2.1 Release: %(echo $RELEASE)%{?dist} # if you want use the parameter of rpm_create on build time, # uncomment below