mirror of
https://gitlab.com/fabinfra/fabaccess/pyfabapi.git
synced 2025-03-12 06:41:42 +01:00
Make work
This commit is contained in:
parent
c8ed03caec
commit
286aca0472
@ -1 +1 @@
|
||||
Subproject commit f02afb3736d1d2d868787168c9b281e5a4058f78
|
||||
Subproject commit 244eb9bd1b59cfcf36c067ff0d6208c0992766ba
|
8
test.py
8
test.py
@ -4,8 +4,8 @@ import fabapi.user_system
|
||||
|
||||
async def main():
|
||||
session = await fabapi.connect("localhost", 59661, "Testuser", "secret")
|
||||
info = await session.machineSystem.info().a_wait()
|
||||
ma = await info.info.getMachineURN("urn:fabaccess:resource:Another").a_wait()
|
||||
info = session.machineSystem.info
|
||||
ma = await info.getMachineURN("urn:fabaccess:resource:Another").a_wait()
|
||||
print(ma)
|
||||
|
||||
# Add an user with the given roles
|
||||
@ -13,9 +13,11 @@ async def main():
|
||||
"somerole", "testrole"
|
||||
]
|
||||
user = await fabapi.user_system.add_user(session.userSystem, "ANewUser", "ANewSecret", roles=roles)
|
||||
print("ANewUser obj: ", user)
|
||||
|
||||
# As you can see, Roles were attached
|
||||
await user.info.listRoles().a_wait()
|
||||
r = await user.info.listRoles().a_wait()
|
||||
print("ANewUser roles: ", r)
|
||||
|
||||
# Delete the same user again
|
||||
await fabapi.user_system.del_user(session.userSystem, "ANewUser")
|
||||
|
Loading…
x
Reference in New Issue
Block a user