parameters: (request, id)
docstring: 根据业务来进行推送安装
      真正的推送在sls_install_id这个函数中。。。这个混乱的逻辑，无数次的权限检查啊
docstring_summary: 根据业务来进行推送安装
      真正的推送在sls_install_id这个函数中。。。这个混乱的逻辑，无数次的权限检查啊
docstring_tokens: 根据业务来进行推送安装 真正的推送在sls_install_id这个函数中。。。这个混乱的逻辑，无数次的权限检查啊
function: def install_id_setup(request, id):
      """
      根据业务来进行推送安装
      真正的推送在sls_install_id这个函数中。。。这个混乱的逻辑，无数次的权限检查啊
      """
      content = {}
      node_name = []
      business_list = []
      business = Project.objects.get(id=id)
      if "jumeiops" in request.user.department:
          user_list = request.user
          user_business = user_list.all_business.values("service_name")
          for i in user_business:
              i = u"%s" % (i["service_name"])
              business_list.append(i)
          # 判断用户是否有当前业务权限
          if business.service_name in business_list:
              node = business.host_set.all()
              for node_key in node:
                  if node_key.status == 1:
                      node_name.append(node_key.node_name)
              content["business"] = business.service_name
              content["node"] = node_name
              content["node_count"] = len(node_name)
              content["setup_id"] = id
              content.update(csrf(request))
              return render_to_response('autoinstall/install_setup_list_count.html', content, context_instance=RequestContext(request))
      elif "admin" in request.user.department:
          admin_node = Host.objects.filter(business=business)
          for i in admin_node:
              if i.status == 1:
                  node_name.append(i.node_name)
          content["business"] = business.service_name
          content["node"] = node_name
          content["node_count"] = len(node_name)
          content["setup_id"] = id
          content.update(csrf(request))
          return render_to_response('autoinstall/install_setup_list_count.html', content, context_instance=RequestContext(request))
      else:
          return HttpResponse("无权限使用")
function_tokens: def install_id_setup ( request , id ) : content = { } node_name = [ ] business_list = [ ] business = Project . objects . get ( id = id ) if "jumeiops" in request . user . department : user_list = request . user user_business = user_list . all_business . values ( "service_name" ) for i in user_business : i = u"%s" % ( i [ "service_name" ] ) business_list . append ( i ) # 判断用户是否有当前业务权限 if business . service_name in business_list : node = business . host_set . all ( ) for node_key in node : if node_key . status == 1 : node_name . append ( node_key . node_name ) content [ "business" ] = business . service_name content [ "node" ] = node_name content [ "node_count" ] = len ( node_name ) content [ "setup_id" ] = id content . update ( csrf ( request ) ) return render_to_response ( 'autoinstall/install_setup_list_count.html' , content , context_instance = RequestContext ( request ) ) elif "admin" in request . user . department : admin_node = Host . objects . filter ( business = business ) for i in admin_node : if i . status == 1 : node_name . append ( i . node_name ) content [ "business" ] = business . service_name content [ "node" ] = node_name content [ "node_count" ] = len ( node_name ) content [ "setup_id" ] = id content . update ( csrf ( request ) ) return render_to_response ( 'autoinstall/install_setup_list_count.html' , content , context_instance = RequestContext ( request ) ) else : return HttpResponse ( "无权限使用")