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
A prog2-höz tartozó friss repo anyagok itt elérhetőek:
https://git.iit.bme.hu/
Commit
4b185b09
authored
Nov 12, 2014
by
Kálmán Viktor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
occi: delete storage
parent
4d56b18f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
0 deletions
+14
-0
circle/occi/occi.py
+10
-0
circle/occi/views.py
+4
-0
No files found.
circle/occi/occi.py
View file @
4b185b09
...
@@ -402,6 +402,7 @@ class Storage(Resource):
...
@@ -402,6 +402,7 @@ class Storage(Resource):
self
.
attrs
[
'occi.storage.size'
]
/=
1024
*
1024
*
1024.0
self
.
attrs
[
'occi.storage.size'
]
/=
1024
*
1024
*
1024.0
def
trigger_action
(
self
,
data
):
def
trigger_action
(
self
,
data
):
# TODO, this is copypaste ATM
method
=
None
method
=
None
action_term
=
None
action_term
=
None
for
d
in
data
:
for
d
in
data
:
...
@@ -428,6 +429,15 @@ class Storage(Resource):
...
@@ -428,6 +429,15 @@ class Storage(Resource):
user
=
User
.
objects
.
get
(
username
=
"test"
)
user
=
User
.
objects
.
get
(
username
=
"test"
)
getattr
(
self
.
instance
,
operation
)
.
async
(
user
=
user
)
getattr
(
self
.
instance
,
operation
)
.
async
(
user
=
user
)
def
delete
(
self
):
# TODO
user
=
User
.
objects
.
get
(
username
=
"test"
)
if
self
.
disk
.
instance_set
.
count
()
>
0
:
for
i
in
self
.
disk
.
instance_set
.
all
():
i
.
detach_disk
(
user
=
user
,
disk
=
self
.
disk
)
self
.
disk
.
destroy
()
class
StorageLink
(
Link
):
class
StorageLink
(
Link
):
def
__init__
(
self
,
instance
=
None
,
disk
=
None
,
data
=
None
):
def
__init__
(
self
,
instance
=
None
,
disk
=
None
,
data
=
None
):
...
...
circle/occi/views.py
View file @
4b185b09
...
@@ -193,6 +193,10 @@ class DiskInterface(DetailView):
...
@@ -193,6 +193,10 @@ class DiskInterface(DetailView):
Storage
(
disk
=
disk
)
.
trigger_action
(
data
)
Storage
(
disk
=
disk
)
.
trigger_action
(
data
)
return
HttpResponse
()
return
HttpResponse
()
def
delete
(
self
,
request
,
*
args
,
**
kwargs
):
Storage
(
disk
=
self
.
get_object
())
.
delete
()
return
HttpResponse
(
""
)
@method_decorator
(
csrf_exempt
)
@method_decorator
(
csrf_exempt
)
def
dispatch
(
self
,
*
args
,
**
kwargs
):
def
dispatch
(
self
,
*
args
,
**
kwargs
):
return
super
(
DiskInterface
,
self
)
.
dispatch
(
*
args
,
**
kwargs
)
return
super
(
DiskInterface
,
self
)
.
dispatch
(
*
args
,
**
kwargs
)
...
...
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