Example #1
0
def login_by_account(name, password, timeout = 60000):
    login = api_actions.LogInByAccountAction()
    login.accountName = name
    login.password = hashlib.sha512(password).hexdigest()
    login.timeout = timeout
    session_uuid = async_call(login, None).inventory.uuid
    return session_uuid
def login_by_account(name, password, timeout=60000):
    login = api_actions.LogInByAccountAction()
    login.accountName = name
    login.password = password
    #login.timeout = 15000
    #since system might be hang for a while, when archive system log in 00:00:00
    #, it is better to increase timeout time to 60000 to avoid of no response
    login.timeout = timeout
    session_uuid = login.run().inventory.uuid
    return session_uuid
Example #3
0
def login_as_admin():
    login = api_actions.LogInByAccountAction()
    login.accountName = inventory.INITIAL_SYSTEM_ADMIN_NAME
    login.password = inventory.INITIAL_SYSTEM_ADMIN_PASSWORD
    #login.timeout = 15000
    #since system might be hang for a while, when archive system log in 00:00:00
    #, it is better to increase timeout time to 60000 to avoid of no response
    login.timeout = 60000
    session_uuid = login.run().inventory.uuid
    return session_uuid