Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
94
Merge Requests
10
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
682fa2b9
authored
9 years ago
by
Czémán Arnold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor modifications
parent
01bf8c3a
Pipeline
#105
failed with stage
in 0 seconds
Changes
6
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
4 additions
and
18 deletions
+4
-18
circle/occi/admin.py
+0
-3
circle/occi/models.py
+0
-3
circle/occi/occi_client_example.py
+0
-5
circle/occi/occi_instances.py
+2
-2
circle/occi/occi_utils.py
+2
-2
circle/occi/tests.py
+0
-3
No files found.
circle/occi/admin.py
deleted
100644 → 0
View file @
01bf8c3a
from
django.contrib
import
admin
# Register your models here.
This diff is collapsed.
Click to expand it.
circle/occi/models.py
deleted
100644 → 0
View file @
01bf8c3a
from
django.db
import
models
# Create your models here.
This diff is collapsed.
Click to expand it.
circle/occi/occi_client_example.py
View file @
682fa2b9
import
requests
from
requests.exceptions
import
ConnectionError
import
json
# import urllib3
...
...
@@ -18,7 +17,6 @@ loginData = {"username": username, "password": password}
# automatikusan benne maradjon az osszes keresunkben
with
requests
.
Session
()
as
session
:
headers
=
{
"Content-Type"
:
"application/json"
,
"Referer"
:
server
}
try
:
# Csrf-Token a bejelentkezeshez
req
=
session
.
get
(
server
+
"occi/login/"
,
headers
=
headers
,
verify
=
False
)
...
...
@@ -149,7 +147,6 @@ with requests.Session() as session:
print
(
json
.
dumps
(
json
.
loads
(
req
.
text
),
sort_keys
=
True
,
indent
=
4
,
separators
=
(
","
,
": "
)))
print
# vm krealas
try
:
headers
[
"X-CSRFToken"
]
=
req
.
cookies
[
"csrftoken"
]
...
...
@@ -198,5 +195,3 @@ with requests.Session() as session:
print
print
(
json
.
dumps
(
json
.
loads
(
req
.
text
),
sort_keys
=
True
,
indent
=
4
,
separators
=
(
","
,
": "
)))
except
ConnectionError
as
e
:
print
(
e
)
This diff is collapsed.
Click to expand it.
circle/occi/occi_instances.py
View file @
682fa2b9
...
...
@@ -215,8 +215,8 @@ CREDENTIALS_MIXIN = Mixin("http://circlecloud.org/occi/infrastructure#",
"credentials"
,
title
=
"Credentials Mixin"
,
attributes
=
CREDENTIALS_ATTRIBUTES
,
applies
=
"http://schemas.ogf.org/occi/
infrastructure
"
+
"#compute"
)
applies
=
"http://schemas.ogf.org/occi/"
+
"
infrastructure
#compute"
)
OS_TPL_MIXIN
=
Mixin
(
"http://schemas.ogf.org/occi/infrastructure#"
,
"os_tpl"
,
...
...
This diff is collapsed.
Click to expand it.
circle/occi/occi_utils.py
View file @
682fa2b9
...
...
@@ -87,8 +87,8 @@ def validate_request(request, authentication_required=True,
if
has_data
:
# checking content type
if
request
.
META
.
get
(
"CONTENT_TYPE"
)
!=
"application/json"
:
raise
OcciRequestNotValid
(
"Only application/json content type
is
"
+
"allowed."
)
raise
OcciRequestNotValid
(
"Only application/json content type"
+
"
is
allowed."
)
# checking if the data is a valid json
try
:
data
=
json
.
loads
(
request
.
body
.
decode
(
"utf-8"
))
...
...
This diff is collapsed.
Click to expand it.
circle/occi/tests.py
deleted
100644 → 0
View file @
01bf8c3a
from
django.test
import
TestCase
# Create your tests here.
This diff is collapsed.
Click to expand it.
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