From 7a73bd98d3256db5a21e1ba655d23c96e28ddb2a Mon Sep 17 00:00:00 2001 From: ibuler Date: Sat, 27 Dec 2014 17:01:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=B5=8B=E8=AF=95=E7=94=A8?= =?UTF-8?q?=E6=88=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/test_add_user.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/test_add_user.py b/docs/test_add_user.py index f0cd7e3a3..c108d16a1 100644 --- a/docs/test_add_user.py +++ b/docs/test_add_user.py @@ -36,12 +36,21 @@ def add_asset(ip, idc, password_common, port=2001, ldap_enable=False, username_c return asset +def add_perm(user, asset, is_ldap, perm_user_type='C'): + perm = Permission(user, asset, is_ldap, perm_user_type) + perm.save() + return perm + + wrm = add_group('wrm') guanghongwei = add_user('guanghongwei', 'guanghongwei', wrm) sd = add_idc('sd') test1 = add_asset('172.16.1.122', sd, 'Lov@j1ax1n') +perm = add_perm(guanghongwei, test1, is_ldap=False) + +