瀏覽代碼

walle 2.0 alpha - add detection passed

walle 6 年之前
父節點
當前提交
ce51bf8c42
共有 2 個文件被更改,包括 6 次插入3 次删除
  1. 4 1
      walle/api/project.py
  2. 2 2
      walle/service/deployer.py

+ 4 - 1
walle/api/project.py

@@ -192,4 +192,7 @@ class ProjectAPI(SecurityResource):
         # remote release directory
 
         errors = Deployer(project_id=project_id).project_detection()
-        return self.render_json(data=errors)
+        message = ''
+        if not errors:
+            message = '配置检测通过,恭喜:)开始你的上线之旅吧'
+        return self.render_json(data=errors, message=message)

+ 2 - 2
walle/service/deployer.py

@@ -321,7 +321,7 @@ class Deployer:
             if result.failed:
                 errors.append({
                     'title': u'远程目标机器免密码登录失败',
-                    'why': u'远程目标机器:%s 错误:%s' % (server_info['host'], result.stdout),
+                    'why': u'远程目标机器:%s 错误:%s' % (server_info['host'], result.stdout),
                     'how': u'在宿主机中配置免密码登录,把宿主机用户%s的~/.ssh/ssh_rsa.pub添加到远程目标机器用户%s的~/.ssh/authorized_keys。了解更多:http://walle-web.io/docs/troubleshooting.html' % (current_app.config.get('LOCAL_SERVER_USER'), server_info['host']),
                 })
 
@@ -331,7 +331,7 @@ class Deployer:
             if result.stdout == 'false':
                 errors.append({
                     'title': u'远程目标机器webroot不能是已建好的目录',
-                    'why': u'远程目标机器%s webroot不能是已建好的目录,必须为软链接,你不必新建,walle会自行创建。' % (server_info['host']),
+                    'why': u'远程目标机器%s webroot不能是已存在的目录,必须为软链接,你不必新建,walle会自行创建。' % (server_info['host']),
                     'how': u'手工删除远程目标机器:%s webroot目录:%s' % (server_info['host'], self.project_info['target_root']),
                 })