Rename and relocate CDC Python examples
Moved the CDC example scripts into the protocol directory and added the .py suffix. Fixed all references to these scripts.
This commit is contained in:
21
server/modules/protocol/examples/cdc_users.py
Executable file
21
server/modules/protocol/examples/cdc_users.py
Executable file
@ -0,0 +1,21 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
# Copyright (c) 2016 MariaDB Corporation Ab
|
||||
#
|
||||
# Use of this software is governed by the Business Source License included
|
||||
# in the LICENSE.TXT file and at www.mariadb.com/bsl.
|
||||
#
|
||||
# Change Date: 2019-01-01
|
||||
#
|
||||
# On the date above, in accordance with the Business Source License, use
|
||||
# of this software will be governed by version 2 or later of the General
|
||||
# Public License.
|
||||
|
||||
import sys, binascii, hashlib, argparse
|
||||
|
||||
parser = argparse.ArgumentParser(description = "CDC User manager", epilog = "Append the output of this program to /var/lib/maxscale/<service name>/cdcusers")
|
||||
parser.add_argument("USER", help="Username")
|
||||
parser.add_argument("PASSWORD", help="Password")
|
||||
opts = parser.parse_args(sys.argv[1:])
|
||||
|
||||
print((opts.USER + ":") + hashlib.sha1(hashlib.sha1(opts.PASSWORD.encode()).digest()).hexdigest().upper())
|
Reference in New Issue
Block a user