Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Fukász Rómeó Ervin
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
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
165eb1d7
authored
Jul 28, 2014
by
Őry Máté
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vm: send absolute url token to agent
parent
4b6c37cb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
+8
-2
circle/dashboard/views.py
+5
-0
circle/vm/models/instance.py
+3
-2
No files found.
circle/dashboard/views.py
View file @
165eb1d7
...
...
@@ -20,6 +20,7 @@ from __future__ import unicode_literals, absolute_import
from
collections
import
OrderedDict
from
itertools
import
chain
from
os
import
getenv
from
urlparse
import
urljoin
import
json
import
logging
import
re
...
...
@@ -3120,3 +3121,7 @@ class UserKeyCreate(LoginRequiredMixin, SuccessMessageMixin, CreateView):
kwargs
=
super
(
UserKeyCreate
,
self
)
.
get_form_kwargs
()
kwargs
[
'user'
]
=
self
.
request
.
user
return
kwargs
def
absolute_url
(
url
):
return
urljoin
(
settings
.
DJANGO_URL
,
url
)
circle/vm/models/instance.py
View file @
165eb1d7
...
...
@@ -673,7 +673,7 @@ class Instance(AclBase, VirtualMachineDescModel, StatusModel, OperatedMixin,
readable_name
=
ugettext_noop
(
"notify owner about expiration"
),
on_commit
=
on_commit
):
from
dashboard.views
import
VmRenewView
from
dashboard.views
import
VmRenewView
,
absolute_url
level
=
self
.
get_level_object
(
"owner"
)
for
u
,
ulevel
in
self
.
get_users_with_level
(
level__pk
=
level
.
pk
):
try
:
...
...
@@ -688,7 +688,8 @@ class Instance(AclBase, VirtualMachineDescModel, StatusModel, OperatedMixin,
else
:
success
.
append
(
u
)
if
self
.
status
==
"RUNNING"
:
token
=
VmRenewView
.
get_token_url
(
self
,
self
.
owner
)
token
=
absolute_url
(
VmRenewView
.
get_token_url
(
self
,
self
.
owner
))
queue
=
self
.
get_remote_queue_name
(
"agent"
)
agent_tasks
.
send_expiration
.
apply_async
(
queue
=
queue
,
args
=
(
self
.
vm_name
,
token
))
...
...
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