Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
main
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Simone Rossi
main
Commits
585bf866
Commit
585bf866
authored
Sep 26, 2016
by
Daniele Venzano
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Validate service names in ZApp descriptions
Fixes #29
parent
4df666f2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
zoe_lib/applications.py
zoe_lib/applications.py
+4
-0
No files found.
zoe_lib/applications.py
View file @
585bf866
...
...
@@ -18,6 +18,7 @@ This module contains code to validate application descriptions.
"""
import
logging
import
re
from
zoe_lib.exceptions
import
InvalidApplicationDescription
import
zoe_lib.version
...
...
@@ -84,6 +85,9 @@ def _service_check(data):
if
k
not
in
data
:
raise
InvalidApplicationDescription
(
msg
=
"Missing required key: %s"
%
k
)
if
not
re
.
match
(
r'^[a-zA-Z0-9\-]+$'
,
data
[
'name'
]):
raise
InvalidApplicationDescription
(
"Service name can contain only letters, numbers and dashes. '{}' is not valid."
.
format
(
data
[
'name'
]))
try
:
bool
(
data
[
'monitor'
])
except
ValueError
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment