@when('config.changed.client_password', 'leadership.is_leader')
def password_changed():
    'Handle password change via the charms config.'
    password = hookenv.config('client_password')
    if ((password == '') and is_state('client.password.initialised')):
        return
    elif (password == ''):
        password = token_generator()
    setup_basic_auth(password, 'admin', 'admin')
    set_state('reconfigure.authentication.setup')
    remove_state('authentication.setup')
    set_state('client.password.initialised')
Handle password change via the charms config.
@when('config.changed.client_password', 'leadership.is_leader')
def password_changed():
    
    password = hookenv.config('client_password')
    if ((password == ) and is_state('client.password.initialised')):
        return
    elif (password == ):
        password = token_generator()
    setup_basic_auth(password, 'admin', 'admin')
    set_state('reconfigure.authentication.setup')
    remove_state('authentication.setup')
    set_state('client.password.initialised')