We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gitlab中多个目录导致saltshake文件服务和state页面文件管理业务异常,经常接口超时,或者返回的目录结构不正确。
The text was updated successfully, but these errors were encountered:
如下文件可以修改为这个中,在尝试一下 https://github.com/saltshaker-plus/saltshaker_api/blob/master/fileserver/git_fs.py
import gitlab from common.db import DB
def gitlab_project(product_id, project_type): db = DB() status, result = db.select_by_id("product", product_id) db.close_mysql() if status is True: if result: product = result else: return {"status": False, "message": "%s does not exist" % product_id} else: return {"status": False, "message": result} try: if product.get("file_server") == "gitfs": gl = gitlab.Gitlab(url=product.get("gitlab_url"), private_token=None if product.get("private_token") is "" else product.get("private_token"), oauth_token=None if product.get("oauth_token") is "" else product.get("oauth_token"), email=None if product.get("email") is "" else product.get("email"), password=None if product.get("password") is "" else product.get("password"), ssl_verify=True, http_username=None if product.get("http_username") is "" else product.get("http_username"), http_password=None if product.get("http_password") is "" else product.get("http_password"), timeout=120, api_version=None if product.get("api_version") is "" else product.get("api_version") ) project = gl.projects.get(product.get(project_type)) return project, product.get(project_type) # 項目过多会慢 #projects = gl.projects.list(all=True) #for pr in projects: #if pr.dict.get('_attrs').get('path_with_namespace') == product.get(project_type): # project = gl.projects.get(pr.dict.get('_attrs').get('id')) #return project, product.get(project_type) #return {"status": False, "message": "Project not found"}, "" else: return {"status": False, "message": "File server is not gitfs"}, "" except Exception as e: return {"status": False, "message": str(e)}
Sorry, something went wrong.
No branches or pull requests
gitlab中多个目录导致saltshake文件服务和state页面文件管理业务异常,经常接口超时,或者返回的目录结构不正确。
The text was updated successfully, but these errors were encountered: