コード例 #1
0
def clean_migrated_mongo_mt(clean_mongo):
    deviceauth_cli = CliDeviceauth()
    useradm_cli = CliUseradm()
    for t in ['tenant1', 'tenant2']:
        deviceauth_cli.migrate(t)
        useradm_cli.migrate(t)

    yield clean_mongo
コード例 #2
0
def clean_migrated_mongo(clean_mongo):
    deviceauth_cli = CliDeviceauth()
    useradm_cli = CliUseradm()

    deviceauth_cli.migrate()
    useradm_cli.migrate()

    yield clean_mongo
コード例 #3
0
def tenants_users(tenants, mongo):
    cu = CliUseradm()
    for t in tenants:
        for i in range(2):
            username = '******'.format(i, t.name)
            pwd = 'correcthorse'
            uid = cu.create_user(username, pwd, t.id)
            t.users.append(User(uid, username, pwd))

    yield tenants
    mongo_cleanup(mongo)
コード例 #4
0
def create_user(name, pwd, tid=''):
    cli = CliUseradm()

    uid = cli.create_user(name, pwd, tid)

    return User(uid, name, pwd)