How to use the towerlib.entities.core.validate_max_length function in towerlib

To help you get started, we’ve selected a few towerlib examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github schubergphilis / towerlib / towerlib / entities / organization.py View on Github external
def custom_virtualenv(self, value):
        """Update the custom_virtualenv of the group.

        Returns:
            None:

        """
        max_characters = 100
        conditions = [validate_max_length(value, max_characters)]
        if all(conditions):
            self._update_values('custom_virtualenv', value)
        else:
            raise InvalidValue('{value} is invalid. Condition max_characters must be less than or equal to '
                               '{max_characters}'.format(value=value, max_characters=max_characters))
github schubergphilis / towerlib / towerlib / entities / inventory_source.py View on Github external
def name(self, value):
        """Update the name of the inventory source.

        Returns:
            None:

        """
        max_characters = 512
        conditions = [validate_max_length(value, max_characters)]
        if all(conditions):
            self._update_values('name', value)
        else:
            raise InvalidValue(('{value} is invalid. Condition max_characters must be '
                                'less or equal to {max_characters}').format(value=value,
                                                                            max_characters=max_characters))
github schubergphilis / towerlib / towerlib / entities / project.py View on Github external
def scm_url(self, value):
        """Update the scm_url project.

        Returns:
            None:

        """
        max_characters = 1024
        conditions = [validate_max_length(value, max_characters)]
        if all(conditions):
            self._update_values('scm_url', value)
        else:
            raise InvalidValue('{value} is invalid. Condition max_characters must be less than or equal to '
                               '{max_characters}'.format(value=value, max_characters=max_characters))
github schubergphilis / towerlib / towerlib / entities / host.py View on Github external
def instance_id(self, value):
        """Update the instance_id of the host.

        Returns:
            None:

        """
        max_characters = 1024
        conditions = [validate_max_length(value, max_characters)]
        if all(conditions):
            self._update_values('instance_id', value)
        else:
            raise InvalidValue('{value} is invalid. Condition max_characters must be less than or equal to '
                               '{max_characters}'.format(value=value, max_characters=max_characters))
github schubergphilis / towerlib / towerlib / entities / project.py View on Github external
def custom_virtualenv(self, value):
        """Update the custom_virtualenv of the group.

        Returns:
            None:

        """
        max_characters = 100
        conditions = [validate_max_length(value, max_characters)]
        if all(conditions):
            self._update_values('custom_virtualenv', value)
        else:
            raise InvalidValue('{value} is invalid. Condition max_characters must be less than or equal to '
                               '{max_characters}'.format(value=value, max_characters=max_characters))
github schubergphilis / towerlib / towerlib / entities / organization.py View on Github external
def name(self, value):
        """Update the name of the organization.

        Returns:
            None:

        """
        max_characters = 512
        conditions = [validate_max_length(value, max_characters)]
        if all(conditions):
            self._update_values('name', value)
        else:
            raise InvalidValue('{value} is invalid. Condition max_characters must be less than or equal to '
                               '{max_characters}'.format(value=value, max_characters=max_characters))
github schubergphilis / towerlib / towerlib / entities / project.py View on Github external
def name(self, value):
        """Update the name of the project.

        Returns:
            None:

        """
        max_characters = 512
        conditions = [validate_max_length(value, max_characters)]
        if all(conditions):
            self._update_values('name', value)
        else:
            raise InvalidValue('{value} is invalid. Condition max_characters must be less than or equal to '
                               '{max_characters}'.format(value=value, max_characters=max_characters))
github schubergphilis / towerlib / towerlib / entities / credential.py View on Github external
def name(self, value):
        """Update the name of the credential type.

        Returns:
            None:

        """
        max_characters = 512
        conditions = [validate_max_length(value, max_characters)]
        if all(conditions):
            self._update_values('name', value)
        else:
            raise InvalidValue('{value} is invalid. Condition max_characters must be less or equal '
                               '{max_characters}'.format(value=value, max_characters=max_characters))
github schubergphilis / towerlib / towerlib / entities / team.py View on Github external
def name(self, value):
        """Update the name of the team.

        Returns:
            None:

        """
        max_characters = 512
        conditions = [validate_max_length(value, max_characters)]
        if all(conditions):
            self._update_values('name', value)
        else:
            raise InvalidValue('{value} is invalid. Condition max_characters must be less or equal to '
                               '{max_characters}'.format(value=value, max_characters=max_characters))
github schubergphilis / towerlib / towerlib / entities / inventory_script.py View on Github external
def name(self, value):
        """Update the name of the inventory script.

        Returns:
            None:

        """
        max_characters = 512
        conditions = [validate_max_length(value, max_characters)]
        if all(conditions):
            self._update_values('name', value)
        else:
            raise InvalidValue(('{value} is invalid. Condition max_characters must be '
                                'less or equal to {max_characters}').format(value=value,
                                                                            max_characters=max_characters))