Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.libnetworkcache
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Ophélie Gagnard
slapos.libnetworkcache
Commits
123d209d
Commit
123d209d
authored
Jun 16, 2011
by
Lucas Carvalho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Raise MultipleFileFoundError.
If the directory has more than one entry, the lib must raise such Error.
parent
51839a7f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletion
+10
-1
slapos/libnetworkcache/__init__.py
slapos/libnetworkcache/__init__.py
+10
-1
No files found.
slapos/libnetworkcache/__init__.py
View file @
123d209d
...
@@ -163,7 +163,16 @@ class NetworkcacheClient(object):
...
@@ -163,7 +163,16 @@ class NetworkcacheClient(object):
if
result
.
status
!=
200
:
if
result
.
status
!=
200
:
raise
DirectoryNotFound
(
result
.
read
())
raise
DirectoryNotFound
(
result
.
read
())
return
json
.
loads
(
data
)
data_list
=
json
.
loads
(
data
)
if
len
(
data_list
)
>
1
:
raise
MultipleFileFoundError
(
'Too many entries for a given directory. '
\
'Directory: %s. Entries: %s.'
%
(
directory_key
,
str
(
data_list
)))
return
data_list
class
MultipleFileFoundError
(
Exception
):
pass
class
DirectoryNotFound
(
Exception
):
class
DirectoryNotFound
(
Exception
):
...
...
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