Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
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
db51287a
authored
Mar 15, 2014
by
Bach Dániel
Committed by
Bach Dániel
Mar 15, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove 'is True' statements
parent
01eb957e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
5 deletions
+4
-5
circle/dashboard/forms.py
+1
-1
circle/vm/models/instance.py
+1
-2
circle/vm/models/node.py
+2
-2
No files found.
circle/dashboard/forms.py
View file @
db51287a
...
@@ -751,7 +751,7 @@ class DiskAddForm(forms.Form):
...
@@ -751,7 +751,7 @@ class DiskAddForm(forms.Form):
self
.
object_pk
=
kwargs
.
pop
(
"object_pk"
)
self
.
object_pk
=
kwargs
.
pop
(
"object_pk"
)
self
.
user
=
kwargs
.
pop
(
"user"
)
self
.
user
=
kwargs
.
pop
(
"user"
)
super
(
DiskAddForm
,
self
)
.
__init__
(
*
args
,
**
kwargs
)
super
(
DiskAddForm
,
self
)
.
__init__
(
*
args
,
**
kwargs
)
self
.
initial
[
'is_template'
]
=
1
if
self
.
is_template
is
True
else
0
self
.
initial
[
'is_template'
]
=
1
if
self
.
is_template
else
0
self
.
initial
[
'object_pk'
]
=
self
.
object_pk
self
.
initial
[
'object_pk'
]
=
self
.
object_pk
def
clean_size
(
self
):
def
clean_size
(
self
):
...
...
circle/vm/models/instance.py
View file @
db51287a
...
@@ -801,10 +801,9 @@ class Instance(AclBase, VirtualMachineDescModel, TimeStampedModel):
...
@@ -801,10 +801,9 @@ class Instance(AclBase, VirtualMachineDescModel, TimeStampedModel):
queue
=
queue_name
queue
=
queue_name
)
.
get
(
timeout
=
timeout
)
)
.
get
(
timeout
=
timeout
)
except
Exception
as
e
:
except
Exception
as
e
:
if
e
.
libvirtError
is
True
and
"Domain not found"
in
str
(
e
):
if
e
.
libvirtError
and
"Domain not found"
in
str
(
e
):
logger
.
debug
(
"Domain
%
s was not found at
%
s"
logger
.
debug
(
"Domain
%
s was not found at
%
s"
%
(
self
.
vm_name
,
queue_name
))
%
(
self
.
vm_name
,
queue_name
))
pass
else
:
else
:
raise
raise
...
...
circle/vm/models/node.py
View file @
db51287a
...
@@ -92,7 +92,7 @@ class Node(TimeStampedModel):
...
@@ -92,7 +92,7 @@ class Node(TimeStampedModel):
def
disable
(
self
,
user
=
None
):
def
disable
(
self
,
user
=
None
):
''' Disable the node.'''
''' Disable the node.'''
if
self
.
enabled
is
True
:
if
self
.
enabled
:
with
node_activity
(
code_suffix
=
'disable'
,
node
=
self
,
user
=
user
):
with
node_activity
(
code_suffix
=
'disable'
,
node
=
self
,
user
=
user
):
self
.
enabled
=
False
self
.
enabled
=
False
self
.
save
()
self
.
save
()
...
@@ -132,7 +132,7 @@ class Node(TimeStampedModel):
...
@@ -132,7 +132,7 @@ class Node(TimeStampedModel):
self
.
node_online
()
self
.
node_online
()
return
self
.
host
.
hostname
+
"."
+
queue_id
return
self
.
host
.
hostname
+
"."
+
queue_id
else
:
else
:
if
self
.
enabled
is
True
:
if
self
.
enabled
:
self
.
node_offline
()
self
.
node_offline
()
raise
WorkerNotFound
()
raise
WorkerNotFound
()
...
...
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