示例#1
0
def password_policy_setup(server, module):
    from imcsdk.apis.admin.user import strong_password_set
    from imcsdk.apis.admin.user import is_strong_password_set

    ansible = module.params
    strong_password = ansible["strong_password"]
    to_enable = (False, True)[strong_password == "enabled"]
    is_enabled = is_strong_password_set(server)
    if to_enable == is_enabled:
        return False

    if not module.check_mode:
        strong_password_set(server, enable=to_enable)
    return True
示例#2
0
def test_unset_strong_password():
    strong_password_set(handle, enable=False)
    assert_equal(is_strong_password_set(handle), False)
示例#3
0
def test_set_strong_password():
    strong_password_set(handle)
    assert_equal(is_strong_password_set(handle), True)
示例#4
0
def test_unset_strong_password():
    strong_password_set(handle, enable=False)
    assert_equal(is_strong_password_set(handle), False)
示例#5
0
def test_set_strong_password():
    strong_password_set(handle)
    assert_equal(is_strong_password_set(handle), True)