def do_clear_store(): stores_path, store_name, store_key, use_keyring = \ obtain_commons(positionals, options) store = Store(stores_path, store_name, store_key) store.open() store.clear_secrets() return store.save()
def do_change_store_key(): stores_path, store_name, store_key, use_keyring = \ obtain_commons(positionals, options) new_store_key = get_positional_or_prompt(positionals, 1, "New store key: ", secure=True, double_check=True) store = Store(stores_path, store_name, store_key) store.open() new_store = Store(stores_path, store_name, new_store_key) new_store.clone_content(store) if not new_store.save(): return False # Remind to delete the keyring keyring_del_key(store_name) return True