def delete_key(key): try: confirm = str_to_bool( input( "Are you sure you want to delete the credentials for key {}? [y/n]\n" .format(key)).lower()) except ValueError: print("Failed to confirm response, key {} wasn't deleted.".format(key)) else: if not confirm: return try: secret_helper.delete_section(key) except (KeyError, ValueError) as e: msg = "Failed to delete credentials for key '{}' in secure DB".format( key) print(msg) else: print("Credentials for the key '{}' was deleted".format(key))
def is_ready(self): return str_to_bool(self.ready)
def is_global(self): return str_to_bool(self.global_)
def is_enabled(self): return str_to_bool(self.disabled)