Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
snf-ganeti
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
Show more breadcrumbs
itminedu
snf-ganeti
Commits
713faea6
Commit
713faea6
authored
16 years ago
by
Oleksiy Mishchenko
Browse files
Options
Downloads
Patches
Plain Diff
ETag passing support.
Reviewed-by: imsnah
parent
a570e2a8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
daemons/ganeti-rapi
+3
-0
3 additions, 0 deletions
daemons/ganeti-rapi
lib/http.py
+5
-0
5 additions, 0 deletions
lib/http.py
lib/rapi/baserlib.py
+7
-0
7 additions, 0 deletions
lib/rapi/baserlib.py
with
15 additions
and
0 deletions
daemons/ganeti-rapi
+
3
−
0
View file @
713faea6
...
...
@@ -61,6 +61,9 @@ class RemoteApiHttpServer(http.HttpServer):
try
:
result
=
fn
()
sn
=
handler
.
getSerialNumber
()
if
sn
:
req
.
response_headers
[
http
.
HTTP_ETAG
]
=
str
(
sn
)
except
:
logging
.
exception
(
"
Error while handling the %s request
"
,
method
)
raise
...
...
This diff is collapsed.
Click to expand it.
lib/http.py
+
5
−
0
View file @
713faea6
...
...
@@ -65,6 +65,7 @@ HTTP_1_1 = "HTTP/1.1"
HTTP_GET
=
"
GET
"
HTTP_HEAD
=
"
HEAD
"
HTTP_ETAG
=
"
ETag
"
class
SocketClosed
(
socket
.
error
):
...
...
@@ -372,6 +373,7 @@ class _HttpConnectionHandler(object):
self
.
response_body
=
None
self
.
response_code
=
HTTP_OK
self
.
response_content_type
=
None
self
.
response_headers
=
{}
self
.
should_fork
=
False
...
...
@@ -484,6 +486,9 @@ class _HttpConnectionHandler(object):
self
.
_SendHeader
(
"
Date
"
,
self
.
_DateTimeHeader
())
self
.
_SendHeader
(
"
Content-Type
"
,
self
.
response_content_type
)
self
.
_SendHeader
(
"
Content-Length
"
,
str
(
len
(
self
.
response_body
)))
for
key
,
val
in
self
.
response_headers
.
iteritems
():
self
.
_SendHeader
(
key
,
val
)
# We don't support keep-alive at this time
self
.
_SendHeader
(
"
Connection
"
,
"
close
"
)
self
.
wfile
.
write
(
"
\r\n
"
)
...
...
This diff is collapsed.
Click to expand it.
lib/rapi/baserlib.py
+
7
−
0
View file @
713faea6
...
...
@@ -137,3 +137,10 @@ class R_Generic(object):
self
.
items
=
items
self
.
queryargs
=
queryargs
self
.
post_data
=
post_data
self
.
sn
=
None
def
getSerialNumber
(
self
):
"""
Get Serial Number.
"""
return
self
.
sn
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