Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
configdb
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
ai
configdb
Commits
b0c0dd70
Commit
b0c0dd70
authored
11 years ago
by
joe
Browse files
Options
Downloads
Patches
Plain Diff
version bump; adding the validator for ip6 fields
parent
0a450485
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
configdb/db/validation.py
+12
-0
12 additions, 0 deletions
configdb/db/validation.py
setup.py
+2
-3
2 additions, 3 deletions
setup.py
with
14 additions
and
3 deletions
configdb/db/validation.py
+
12
−
0
View file @
b0c0dd70
import
formencode
import
formencode
import
ipaddr
from
formencode
import
validators
from
formencode
import
validators
Invalid
=
formencode
.
Invalid
Invalid
=
formencode
.
Invalid
...
@@ -16,6 +17,14 @@ class RelationValidator(formencode.FancyValidator):
...
@@ -16,6 +17,14 @@ class RelationValidator(formencode.FancyValidator):
return
value
return
value
raise
Invalid
(
'
relation not a list of strings
'
,
value
,
state
)
raise
Invalid
(
'
relation not a list of strings
'
,
value
,
state
)
class
IP6Address
(
formencode
.
FancyValidator
):
def
_to_python
(
self
,
addr
,
state
):
try
:
ipaddr
.
IPv6Network
(
address
=
addr
)
return
addr
except
ipaddr
.
AddressValueError
,
e
:
raise
Invalid
(
'
Not a well formed IPv6 address
'
,
addr
,
state
)
_validator_map
=
{
_validator_map
=
{
'
int
'
:
validators
.
Int
(),
'
int
'
:
validators
.
Int
(),
...
@@ -28,9 +37,12 @@ _validator_map = {
...
@@ -28,9 +37,12 @@ _validator_map = {
'
ip
'
:
validators
.
IPAddress
(),
'
ip
'
:
validators
.
IPAddress
(),
'
cidr
'
:
validators
.
CIDR
(),
'
cidr
'
:
validators
.
CIDR
(),
'
relation
'
:
RelationValidator
(),
'
relation
'
:
RelationValidator
(),
'
ip6
'
:
IP6Address
(),
}
}
class
ValidatorMixin
(
object
):
class
ValidatorMixin
(
object
):
"""
Mixin class for entity validation.
"""
"""
Mixin class for entity validation.
"""
...
...
This diff is collapsed.
Click to expand it.
setup.py
100644 → 100755
+
2
−
3
View file @
b0c0dd70
...
@@ -4,13 +4,13 @@ from setuptools import setup, find_packages
...
@@ -4,13 +4,13 @@ from setuptools import setup, find_packages
setup
(
setup
(
name
=
'
configdb
'
,
name
=
'
configdb
'
,
version
=
'
0.2.
1
'
,
version
=
'
0.2.
2
'
,
description
=
'
database framework for configuration info
'
,
description
=
'
database framework for configuration info
'
,
author
=
'
ale
'
,
author
=
'
ale
'
,
author_email
=
'
ale@incal.net
'
,
author_email
=
'
ale@incal.net
'
,
url
=
'
http://git.autistici.org/p/configdb
'
,
url
=
'
http://git.autistici.org/p/configdb
'
,
install_requires
=
[
'
argparse
'
,
'
Flask
'
,
'
formencode
'
,
'
inflect
'
,
install_requires
=
[
'
argparse
'
,
'
Flask
'
,
'
formencode
'
,
'
inflect
'
,
'
SQLAlchemy>0.7
'
,
'
python-dateutil
'
],
'
SQLAlchemy>0.7
'
,
'
python-dateutil
'
,
'
ipaddr
'
],
setup_requires
=
[],
setup_requires
=
[],
zip_safe
=
True
,
zip_safe
=
True
,
packages
=
find_packages
(),
packages
=
find_packages
(),
...
@@ -21,4 +21,3 @@ setup(
...
@@ -21,4 +21,3 @@ setup(
],
],
},
},
)
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment