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',
help='Directory containing server '
'data and cache files (default: %s)'
% os.path.join(default_base, "var"))
parser.add_argument('--delete',
default=False, action='store_const',
const=True,
help='Delete unknown users and groups')
parser.add_argument('--delete', action='store_true', help='Delete unknown users and groups')
parser.add_argument('--users', action='store_true', help='Sync users')
parser.add_argument('--groups', action='store_true', help='Sync groups')
args = parser.parse_args()
......@@ -40,5 +39,7 @@ if ldapexport.connect():
session.configure(bind=db)
if args.delete:
ldapexport.delete_unknown(session)
if args.users:
ldapexport.sync_all_users(session)
if args.groups:
ldapexport.sync_all_groups(session)
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