代码拉取完成,页面将自动刷新
from Merge import *
jifang()
start = input('请输入起始机房:=')
end = input('请输入目标机房:=')
end_region = None
start_region = None
def cloud():
global end, end_region, start, start_region
if (start and end) in all_list:
start_region = all_dict['{}'.format(start)]
end_region = all_dict['{}'.format(end)]
else:
print('起始机房or目标机房填写有误,请重新填写!')
def equipment_add():
add1 = f"update province_city_region set region_add='{end_region}', region_shift='{end_region}';" # 忽略报错
add2 = f"update region_config set to_count='5000000' where region='{end_region}';"
add3 = f"update region_config set to_count='0' where region='{start_region}';"
find1 = "select region_add,region_shift from province_city_region;"
find2 = "select region,to_count from region_config;"
sql1 = 'ssh bj-china-db-coredata'
sql2 = 'mysql core_data'
print('\n' + '-----------------执行命令-------------------')
print(sql1+'\n'+sql2)
print(add1+'\n'+add2+'\n'+add3)
print('\n' + '-----------------查看语句-------------------')
print(find1+'\n'+find2)
if __name__ == '__main__':
cloud()
if end_region is None or start_region is None:
print('end_region or start_region parameter is none!')
else:
equipment_add()
# 设置新增设备上线的默认机房 core_data数据库
# update province_city_region set region_add='hz10-acloud', region_shift='hz10-acloud';
# update region_config set to_count='5000000' where region='hz10-acloud';
# update region_config set to_count='0' where region='sh-acloud';
# 查看语句
# select region_add,region_shift from province_city_region;
# select region,to_count from region_config;
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。