mirror of https://github.com/jumpserver/jumpserver
bug fix
parent
e117cd003f
commit
23051a4a05
|
@ -430,7 +430,6 @@ def perm_role_push(request):
|
||||||
group_assets_obj.extend(asset_group.asset_set.all())
|
group_assets_obj.extend(asset_group.asset_set.all())
|
||||||
calc_assets = list(set(assets_obj) | set(group_assets_obj))
|
calc_assets = list(set(assets_obj) | set(group_assets_obj))
|
||||||
push_resource = gen_resource(calc_assets)
|
push_resource = gen_resource(calc_assets)
|
||||||
logger.debug('Push role res: %s' % push_resource)
|
|
||||||
|
|
||||||
# 调用Ansible API 进行推送
|
# 调用Ansible API 进行推送
|
||||||
password_push = True if request.POST.get("use_password") else False
|
password_push = True if request.POST.get("use_password") else False
|
||||||
|
@ -451,7 +450,8 @@ def perm_role_push(request):
|
||||||
# 3. 推送sudo配置文件
|
# 3. 推送sudo配置文件
|
||||||
if password_push or key_push:
|
if password_push or key_push:
|
||||||
sudo_list = set([sudo for sudo in role.sudo.all()]) # set(sudo1, sudo2, sudo3)
|
sudo_list = set([sudo for sudo in role.sudo.all()]) # set(sudo1, sudo2, sudo3)
|
||||||
ret['sudo'] = task.push_sudo_file([role], sudo_list)
|
if sudo_list:
|
||||||
|
ret['sudo'] = task.push_sudo_file([role], sudo_list)
|
||||||
|
|
||||||
logger.debug('推送role结果: %s' % ret)
|
logger.debug('推送role结果: %s' % ret)
|
||||||
success_asset = {}
|
success_asset = {}
|
||||||
|
|
|
@ -491,7 +491,6 @@ def defend_attack(func):
|
||||||
return HttpResponse('Forbidden', status=403)
|
return HttpResponse('Forbidden', status=403)
|
||||||
request.session['visit'] = request.session.get('visit', 1) + 1
|
request.session['visit'] = request.session.get('visit', 1) + 1
|
||||||
request.session.set_expiry(300)
|
request.session.set_expiry(300)
|
||||||
logger.debug(request.session.get('visit'))
|
|
||||||
return func(request, *args, **kwargs)
|
return func(request, *args, **kwargs)
|
||||||
return _deco
|
return _deco
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue