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
acdf8145
authored
Apr 19, 2013
by
Őry Máté
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
django: remove update_state calls (temp. fix??)
parent
b9e6d1b4
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
6 deletions
+3
-6
firewall/models.py
+1
-1
one/admin.py
+0
-3
one/jobs/hourly/update.py
+2
-2
No files found.
firewall/models.py
View file @
acdf8145
...
@@ -236,7 +236,7 @@ class Host(models.Model):
...
@@ -236,7 +236,7 @@ class Host(models.Model):
res
=
self
.
record_set
.
filter
(
type
=
'A'
)
res
=
self
.
record_set
.
filter
(
type
=
'A'
)
return
unicode
(
res
[
0
]
.
get_data
()[
'name'
])
return
unicode
(
res
[
0
]
.
get_data
()[
'name'
])
except
:
except
:
raise
#
raise
if
self
.
shared_ip
:
if
self
.
shared_ip
:
return
self
.
pub_ipv4
return
self
.
pub_ipv4
else
:
else
:
...
...
one/admin.py
View file @
acdf8145
...
@@ -66,19 +66,16 @@ submit_vm.short_description = _('Submit VM')
...
@@ -66,19 +66,16 @@ submit_vm.short_description = _('Submit VM')
def
delete_vm
(
modeladmin
,
request
,
queryset
):
def
delete_vm
(
modeladmin
,
request
,
queryset
):
for
i
in
queryset
.
exclude
(
state
=
'DONE'
)
.
all
():
for
i
in
queryset
.
exclude
(
state
=
'DONE'
)
.
all
():
i
.
one_delete
()
i
.
one_delete
()
i
.
update_state
()
delete_vm
.
short_description
=
_
(
'Delete VM'
)
delete_vm
.
short_description
=
_
(
'Delete VM'
)
def
suspend_vm
(
modeladmin
,
request
,
queryset
):
def
suspend_vm
(
modeladmin
,
request
,
queryset
):
for
i
in
queryset
.
filter
(
state
=
'ACTIVE'
)
.
all
():
for
i
in
queryset
.
filter
(
state
=
'ACTIVE'
)
.
all
():
i
.
stop
()
i
.
stop
()
i
.
update_state
()
suspend_vm
.
short_description
=
_
(
'Suspend VM'
)
suspend_vm
.
short_description
=
_
(
'Suspend VM'
)
def
resume_vm
(
modeladmin
,
request
,
queryset
):
def
resume_vm
(
modeladmin
,
request
,
queryset
):
for
i
in
queryset
.
filter
(
state__in
=
(
'STOPPED'
,
'SUSPENDED'
))
.
all
():
for
i
in
queryset
.
filter
(
state__in
=
(
'STOPPED'
,
'SUSPENDED'
))
.
all
():
i
.
resume
()
i
.
resume
()
i
.
update_state
()
resume_vm
.
short_description
=
_
(
'Resume VM'
)
resume_vm
.
short_description
=
_
(
'Resume VM'
)
...
...
one/jobs/hourly/update.py
View file @
acdf8145
...
@@ -7,6 +7,6 @@ class Job(HourlyJob):
...
@@ -7,6 +7,6 @@ class Job(HourlyJob):
def
execute
(
self
):
def
execute
(
self
):
Disk
.
update
()
Disk
.
update
()
Network
.
update
()
Network
.
update
()
for
i
in
Instance
.
objects
.
filter
(
state__in
=
[
'ACTIVE'
,
'STOPPED'
],
time_of_delete__isnull
=
False
):
#
for i in Instance.objects.filter(state__in=['ACTIVE', 'STOPPED'], time_of_delete__isnull=False):
i
.
update_state
()
#
i.update_state()
pass
pass
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