Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gutyán Gábor
/
circlestack
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
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
Show 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
...
@@ -20,6 +20,7 @@ from __future__ import unicode_literals, absolute_import
from
collections
import
OrderedDict
from
collections
import
OrderedDict
from
itertools
import
chain
from
itertools
import
chain
from
os
import
getenv
from
os
import
getenv
from
urlparse
import
urljoin
import
json
import
json
import
logging
import
logging
import
re
import
re
...
@@ -3120,3 +3121,7 @@ class UserKeyCreate(LoginRequiredMixin, SuccessMessageMixin, CreateView):
...
@@ -3120,3 +3121,7 @@ class UserKeyCreate(LoginRequiredMixin, SuccessMessageMixin, CreateView):
kwargs
=
super
(
UserKeyCreate
,
self
)
.
get_form_kwargs
()
kwargs
=
super
(
UserKeyCreate
,
self
)
.
get_form_kwargs
()
kwargs
[
'user'
]
=
self
.
request
.
user
kwargs
[
'user'
]
=
self
.
request
.
user
return
kwargs
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,
...
@@ -673,7 +673,7 @@ class Instance(AclBase, VirtualMachineDescModel, StatusModel, OperatedMixin,
readable_name
=
ugettext_noop
(
readable_name
=
ugettext_noop
(
"notify owner about expiration"
),
"notify owner about expiration"
),
on_commit
=
on_commit
):
on_commit
=
on_commit
):
from
dashboard.views
import
VmRenewView
from
dashboard.views
import
VmRenewView
,
absolute_url
level
=
self
.
get_level_object
(
"owner"
)
level
=
self
.
get_level_object
(
"owner"
)
for
u
,
ulevel
in
self
.
get_users_with_level
(
level__pk
=
level
.
pk
):
for
u
,
ulevel
in
self
.
get_users_with_level
(
level__pk
=
level
.
pk
):
try
:
try
:
...
@@ -688,7 +688,8 @@ class Instance(AclBase, VirtualMachineDescModel, StatusModel, OperatedMixin,
...
@@ -688,7 +688,8 @@ class Instance(AclBase, VirtualMachineDescModel, StatusModel, OperatedMixin,
else
:
else
:
success
.
append
(
u
)
success
.
append
(
u
)
if
self
.
status
==
"RUNNING"
:
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"
)
queue
=
self
.
get_remote_queue_name
(
"agent"
)
agent_tasks
.
send_expiration
.
apply_async
(
agent_tasks
.
send_expiration
.
apply_async
(
queue
=
queue
,
args
=
(
self
.
vm_name
,
token
))
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