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
Commit
0cf2b4c6
authored
Mar 06, 2014
by
Őry Máté
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vm: add activity to Instance.renew
parent
42cc6856
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletions
+7
-1
circle/vm/models/instance.py
+7
-1
No files found.
circle/vm/models/instance.py
View file @
0cf2b4c6
...
@@ -632,9 +632,15 @@ class Instance(AclBase, VirtualMachineDescModel, TimeStampedModel):
...
@@ -632,9 +632,15 @@ class Instance(AclBase, VirtualMachineDescModel, TimeStampedModel):
timezone
.
now
()
+
self
.
lease
.
suspend_interval
,
timezone
.
now
()
+
self
.
lease
.
suspend_interval
,
timezone
.
now
()
+
self
.
lease
.
delete_interval
)
timezone
.
now
()
+
self
.
lease
.
delete_interval
)
def
renew
(
self
,
which
=
'both'
):
def
renew
(
self
,
which
=
'both'
,
base_activity
=
None
,
user
=
None
):
"""Renew virtual machine instance leases.
"""Renew virtual machine instance leases.
"""
"""
if
base_activity
is
None
:
act
=
instance_activity
(
code_suffix
=
'renew'
,
instance
=
self
,
user
=
user
)
else
:
act
=
base_activity
.
sub_activity
(
'renew'
)
with
act
:
if
which
not
in
(
'suspend'
,
'delete'
,
'both'
):
if
which
not
in
(
'suspend'
,
'delete'
,
'both'
):
raise
ValueError
(
'No such expiration type.'
)
raise
ValueError
(
'No such expiration type.'
)
time_of_suspend
,
time_of_delete
=
self
.
get_renew_times
()
time_of_suspend
,
time_of_delete
=
self
.
get_renew_times
()
...
...
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