Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
snf-image-creator
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-image-creator
Commits
6152a559
Commit
6152a559
authored
12 years ago
by
Nikos Skalkotos
Browse files
Options
Downloads
Patches
Plain Diff
Fix pep8 errors
parent
8e3065a0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
image_creator/kamaki_wrapper.py
+4
-4
4 additions, 4 deletions
image_creator/kamaki_wrapper.py
image_creator/util.py
+3
-2
3 additions, 2 deletions
image_creator/util.py
with
7 additions
and
6 deletions
image_creator/kamaki_wrapper.py
+
4
−
4
View file @
6152a559
...
@@ -73,10 +73,10 @@ class Kamaki:
...
@@ -73,10 +73,10 @@ class Kamaki:
raise
FatalError
(
"
Pithos client: %d %s
"
%
\
raise
FatalError
(
"
Pithos client: %d %s
"
%
\
(
e
.
status
,
e
.
message
))
(
e
.
status
,
e
.
message
))
try
:
try
:
hash_progress
=
progress
(
"
(1/2) Calculating block hashes:
"
)
hash_progress
=
progress
(
"
(1/2) Calculating block hashes:
"
)
upload_progress
=
progress
(
"
(2/2) Uploading missing blocks:
"
)
upload_progress
=
progress
(
"
(2/2) Uploading missing blocks:
"
)
self
.
pithos_client
.
create_object
(
remote_path
,
f
,
size
,
self
.
pithos_client
.
create_object
(
remote_path
,
f
,
size
,
hash_progress
,
upload_progress
)
hash_progress
,
upload_progress
)
self
.
uploaded_object
=
"
pithos://%s/%s/%s
"
%
\
self
.
uploaded_object
=
"
pithos://%s/%s/%s
"
%
\
(
self
.
account
,
self
.
container
,
remote_path
)
(
self
.
account
,
self
.
container
,
remote_path
)
except
ClientError
as
e
:
except
ClientError
as
e
:
...
@@ -86,4 +86,4 @@ class Kamaki:
...
@@ -86,4 +86,4 @@ class Kamaki:
def
register
(
self
,
metadata
):
def
register
(
self
,
metadata
):
pass
pass
# vim: set sta sts=4 shiftwidth=4 sw=4 et ai
# vim: set sta sts=4 shiftwidth=4 sw=4 et ai
:
This diff is collapsed.
Click to expand it.
image_creator/util.py
+
3
−
2
View file @
6152a559
...
@@ -100,9 +100,10 @@ def progress(message=''):
...
@@ -100,9 +100,10 @@ def progress(message=''):
yield
# suppress the StopIteration exception
yield
# suppress the StopIteration exception
return
progress_generator
return
progress_generator
def
md5
(
filename
,
size
,
progress
=
None
):
BLOCKSIZE
=
2
^
22
# 4MB
def
md5
(
filename
,
size
,
progress
=
None
):
BLOCKSIZE
=
2
^
22
# 4MB
md5
=
hashlib
.
md5
()
md5
=
hashlib
.
md5
()
with
open
(
filename
,
"
r
"
)
as
src
:
with
open
(
filename
,
"
r
"
)
as
src
:
...
...
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