Example #1
0
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))
Example #2
0
 def is_ready(self):
     return str_to_bool(self.ready)
Example #3
0
 def is_global(self):
     return str_to_bool(self.global_)
Example #4
0
 def is_enabled(self):
     return str_to_bool(self.disabled)