gcs/project.py
def delete_key(self, key_id, context):
        """Delete an existing HMAC key from the service account."""
        key = self.keys.get(key_id)
        if key is None:
            return testbench.error.notfound("key %s" % key_id, context)
        resource = key.get("metadata")
        # by constructions our keys always have a `metadata`` field
        assert resource is not None
        if resource.get("state") == "ACTIVE":
            return testbench.error.invalid("Deleting ACTIVE key %s" % key_id, context)
        resource["state"] = "DELETED"
        self.keys.pop(key_id)
        return resource
Delete an existing HMAC key from the service account.
Delete an existing HMAC key from the service account.
Delete an existing HMAC key from the service account .
def delete_key(self, key_id, context):
        key = self.keys.get(key_id)
        if key is None:
            return testbench.error.notfound("key %s" % key_id, context)
        resource = key.get("metadata")
        assert resource is not None
        if resource.get("state") == "ACTIVE":
            return testbench.error.invalid("Deleting ACTIVE key %s" % key_id, context)
        resource["state"] = "DELETED"
        self.keys.pop(key_id)
        return resource
def delete_key ( self , key_id , context ) : key = self . keys . get ( key_id ) if key is None : return testbench . error . notfound ( "key %s" % key_id , context ) resource = key . get ( "metadata" ) assert resource is not None if resource . get ( "state" ) == "ACTIVE" : return testbench . error . invalid ( "Deleting ACTIVE key %s" % key_id , context ) resource [ "state" ] = "DELETED" self . keys . pop ( key_id ) return resource
Delete an existing HMAC key from the service account.
Delete an existing HMAC key from the service account .
"""Delete an existing HMAC key from the service account.""" # by constructions our keys always have a `metadata`` field
self
key_id
context