Set the values in disk.0.os.credentials.*.

def setCredentialValues(self, username=None, password=None, public_key=None, private_key=None, new=False):
        """Set the values in disk.0.os.credentials.*."""

        credentials_base = "disk.0.os.credentials."
        if new:
            credentials_base = "disk.0.os.credentials.new."

        if username:
            self.setValue(credentials_base + "username", username)
        if password:
            self.setValue(credentials_base + "password", password)
        if public_key:
            self.setValue(credentials_base + "public_key", public_key)
        if private_key:
            self.setValue(credentials_base + "private_key", private_key)