Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
agkyra
Commits
71c67ef2
Commit
71c67ef2
authored
May 26, 2015
by
Giorgos Korfiatis
Browse files
make container if not exists
parent
723eadd4
Changes
1
Hide whitespace changes
Inline
Side-by-side
agkyra/syncer/setup.py
View file @
71c67ef2
...
...
@@ -168,7 +168,22 @@ class SyncerSettings():
raise
try
:
account
=
astakos
.
user_info
[
'id'
]
return
PithosClient
(
PITHOS_URL
,
token
,
account
,
container
)
client
=
PithosClient
(
PITHOS_URL
,
token
,
account
,
container
)
except
ClientError
:
logger
.
error
(
"Failed to initialize Pithos client"
)
raise
try
:
client
.
get_container_info
(
container
)
except
ClientError
as
e
:
if
e
.
status
==
404
:
logger
.
warning
(
"Container '%s' does not exist, creating..."
%
container
)
try
:
client
.
create_container
(
container
)
except
ClientError
:
logger
.
error
(
"Failed to create container '%s'"
%
container
)
raise
else
:
raise
return
client
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