mirror of
https://github.com/samba-team/samba.git
synced 2024-12-25 23:21:54 +03:00
a19d5bd771
Samba default python is 3 now. Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Noel Power <npower@samba.org>
31 lines
703 B
Python
Executable File
31 lines
703 B
Python
Executable File
#!/usr/bin/env python3
|
|
import optparse
|
|
import sys
|
|
|
|
# Find right directory when running from source tree
|
|
sys.path.insert(0, "bin/python")
|
|
|
|
|
|
import samba
|
|
from samba import getopt as options
|
|
from samba.credentials import Credentials
|
|
parser = optparse.OptionParser("machineaccountccache <ccache name>")
|
|
sambaopts = options.SambaOptions(parser)
|
|
parser.add_option_group(sambaopts)
|
|
parser.add_option_group(options.VersionOptions(parser))
|
|
opts, args = parser.parse_args()
|
|
|
|
if len(args) != 1:
|
|
parser.print_usage()
|
|
sys.exit(1)
|
|
|
|
ccachename = args[0]
|
|
|
|
lp_ctx = sambaopts.get_loadparm()
|
|
|
|
creds = Credentials()
|
|
|
|
creds.guess(lp_ctx)
|
|
creds.set_machine_account(lp_ctx)
|
|
creds.get_named_ccache(lp_ctx, ccachename)
|