Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Lu Xu
slapos.core
Commits
77ad079b
Commit
77ad079b
authored
Oct 09, 2012
by
Cédric de Saint Martin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Usage Report in case of not empty partition with no SR
parent
c17ae1b1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
slapos/grid/slapgrid.py
slapos/grid/slapgrid.py
+10
-2
No files found.
slapos/grid/slapgrid.py
View file @
77ad079b
...
@@ -939,6 +939,10 @@ class Slapgrid(object):
...
@@ -939,6 +939,10 @@ class Slapgrid(object):
def
agregateAndSendUsage
(
self
):
def
agregateAndSendUsage
(
self
):
"""Will agregate usage from each Computer Partition.
"""Will agregate usage from each Computer Partition.
"""
"""
# Prepares environment
self
.
checkEnvironmentAndCreateStructure
()
self
.
_launchSupervisord
()
slap_computer_usage
=
self
.
slap
.
registerComputer
(
self
.
computer_id
)
slap_computer_usage
=
self
.
slap
.
registerComputer
(
self
.
computer_id
)
computer_partition_usage_list
=
[]
computer_partition_usage_list
=
[]
logger
=
logging
.
getLogger
(
'UsageReporting'
)
logger
=
logging
.
getLogger
(
'UsageReporting'
)
...
@@ -1113,9 +1117,13 @@ class Slapgrid(object):
...
@@ -1113,9 +1117,13 @@ class Slapgrid(object):
if
computer_partition
.
getState
()
==
COMPUTER_PARTITION_DESTROYED_STATE
:
if
computer_partition
.
getState
()
==
COMPUTER_PARTITION_DESTROYED_STATE
:
try
:
try
:
computer_partition_id
=
computer_partition
.
getId
()
computer_partition_id
=
computer_partition
.
getId
()
try
:
software_url
=
computer_partition
.
getSoftwareRelease
().
getURI
()
software_url
=
computer_partition
.
getSoftwareRelease
().
getURI
()
software_path
=
os
.
path
.
join
(
self
.
software_root
,
software_path
=
os
.
path
.
join
(
self
.
software_root
,
getSoftwareUrlHash
(
software_url
))
getSoftwareUrlHash
(
software_url
))
except
(
NotFoundError
,
TypeError
):
software_url
=
None
software_path
=
None
local_partition
=
Partition
(
local_partition
=
Partition
(
software_path
=
software_path
,
software_path
=
software_path
,
instance_path
=
os
.
path
.
join
(
self
.
instance_root
,
instance_path
=
os
.
path
.
join
(
self
.
instance_root
,
...
...
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