Commit c5034271 authored by tarak.li's avatar tarak.li

添加商城多次部署处理逻辑

parent 88928a50
......@@ -68,8 +68,6 @@ def read_local_ip():
def update_local_proxy(conf, local):
proxy = conf.get("Proxy", [])
proxys = [item.get("name", "") for item in proxy]
print("proxys", proxys)
print(local)
_local = []
for k, v in local.items():
if k not in proxys and len(v.split(":")) == 2:
......
......@@ -85,6 +85,9 @@ def auto_install_bt(ip, username, password, site, webname, host_id=0):
print("更新商城信息")
update_shop_info(site, webname, host_id, status=1, remark="商城部署成功", url=site)
if "一键配置商城信息失败" in result:
update_shop_info(site, webname, host_id, status=3, remark="商城部署失败,请重试", url=site)
except AuthenticationException as err:
update_shop_info(site, webname, host_id, status=3, remark="连接失败,请检查远程信息")
finally:
......@@ -108,6 +111,6 @@ def main():
if __name__ == '__main__':
# push_file('121.196.33.88', 'root', 'Aa123456')
# auto_install_bt('121.196.33.88', 'root', 'Aa123456', "www.gingboutrade.com", "测试商城")
auto_install_bt('121.196.33.88', 'root', 'Aa123456', "www.gingboutrade.com", "测试商城")
# update_shop_info(site="www.test.com", webname="测试商城1", test="")
main()
# main()
......@@ -135,7 +135,7 @@ def free_host():
db = get_db()
sql = """select a.id as id
from tp_remote_host a LEFT join tp_remote_account_host_bind b on a.id = b.host_id
where b.id is null"""
where b.id is null and os_type=1"""
if host_id_lock:
not_id = ' and a.id not in ({})'.format(','.join([str(id) for id in host_id_lock.keys()]))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment