Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
snf-occi
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
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
itminedu
snf-occi
Commits
03ca6c4a
Commit
03ca6c4a
authored
Jul 29, 2016
by
Stavros Sachtouris
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reduce astakos calls: extract more from one call
parent
e90cae61
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
snfOCCI/APIserver.py
snfOCCI/APIserver.py
+7
-7
No files found.
snfOCCI/APIserver.py
View file @
03ca6c4a
...
...
@@ -26,7 +26,7 @@ from kamaki.clients.cyclades import CycladesNetworkClient
from
snfOCCI.extensions
import
snf_addons
from
kamaki.clients.cyclades
import
CycladesComputeClient
from
kamaki.clients
import
astakos
from
kamaki.clients
.astakos
import
AstakosClient
from
kamaki.clients
import
ClientError
from
occi.core_model
import
Mixin
,
Resource
...
...
@@ -268,15 +268,15 @@ class MyAPP(wsgi.Application):
snf_project
=
req
.
environ
[
'HTTP_X_SNF_PROJECT'
]
except
KeyError
:
print
"No project provided, go to plan B"
astakos
Client
=
astakos
.
AstakosClient
(
astakos
=
AstakosClient
(
config
.
KAMAKI
[
'astakos_url'
],
environ
[
'HTTP_AUTH_TOKEN'
])
projects
=
astakosClient
.
get_projects
()
user_info
=
astakosClient
.
authenticate
()
user_info
=
astakos
.
authenticate
()
projects
=
user_info
[
'access'
][
'user'
][
'projects'
]
user_uuid
=
user_info
[
'access'
][
'user'
][
'id'
]
snf_project
=
'6d9ec935-fcd4-4ae1-a3a0-10e612c4f867'
snf_project
=
user_uuid
for
project
in
projects
:
if
project
[
'id'
]
!=
user_uuid
:
snf_project
=
project
[
'id'
]
if
project
!=
user_uuid
:
snf_project
=
project
print
"Project found"
break
...
...
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