Commit 71815188 authored by Benjamin Fischer's avatar Benjamin Fischer

LDAP-Export: added arguments

parent 9d605ae2
...@@ -24,10 +24,9 @@ parser.add_argument('-d', '--data-dir', dest='vardir', ...@@ -24,10 +24,9 @@ parser.add_argument('-d', '--data-dir', dest='vardir',
help='Directory containing server ' help='Directory containing server '
'data and cache files (default: %s)' 'data and cache files (default: %s)'
% os.path.join(default_base, "var")) % os.path.join(default_base, "var"))
parser.add_argument('--delete', parser.add_argument('--delete', action='store_true', help='Delete unknown users and groups')
default=False, action='store_const', parser.add_argument('--users', action='store_true', help='Sync users')
const=True, parser.add_argument('--groups', action='store_true', help='Sync groups')
help='Delete unknown users and groups')
args = parser.parse_args() args = parser.parse_args()
...@@ -40,5 +39,7 @@ if ldapexport.connect(): ...@@ -40,5 +39,7 @@ if ldapexport.connect():
session.configure(bind=db) session.configure(bind=db)
if args.delete: if args.delete:
ldapexport.delete_unknown(session) ldapexport.delete_unknown(session)
ldapexport.sync_all_users(session) if args.users:
ldapexport.sync_all_groups(session) ldapexport.sync_all_users(session)
if args.groups:
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment