Commit 21fdbbc4 authored by Cédric Le Ninivin's avatar Cédric Le Ninivin

slapgrid: wip continue working on new API

parent d37500fe
...@@ -1730,7 +1730,6 @@ stderr_logfile_backups=1 ...@@ -1730,7 +1730,6 @@ stderr_logfile_backups=1
self.checkEnvironmentAndCreateStructure() self.checkEnvironmentAndCreateStructure()
self._launchSupervisord() self._launchSupervisord()
slap_computer_usage = self.slap.registerComputer(self.computer_id)
computer_partition_usage_list = [] computer_partition_usage_list = []
self.logger.info('Aggregating and sending usage reports...') self.logger.info('Aggregating and sending usage reports...')
...@@ -1760,7 +1759,7 @@ stderr_logfile_backups=1 ...@@ -1760,7 +1759,7 @@ stderr_logfile_backups=1
clean_run = True clean_run = True
# Loop over the different computer partitions # Loop over the different computer partitions
computer_partition_list = self.FilterComputerPartitionList( computer_partition_list = self.FilterComputerPartitionList(
slap_computer_usage.getComputerPartitionList()) self.getComputerPartitionList())
for computer_partition in computer_partition_list: for computer_partition in computer_partition_list:
try: try:
...@@ -1895,7 +1894,7 @@ stderr_logfile_backups=1 ...@@ -1895,7 +1894,7 @@ stderr_logfile_backups=1
if self.validateXML(usage, computer_consumption_model): if self.validateXML(usage, computer_consumption_model):
self.logger.info('XML file generated by asXML is valid') self.logger.info('XML file generated by asXML is valid')
slap_computer_usage.reportUsage(usage) self.computer.reportUsage(usage)
filename_delete_list.append(filename) filename_delete_list.append(filename)
else: else:
self.logger.info('XML file is invalid %s' % file_path) self.logger.info('XML file is invalid %s' % file_path)
...@@ -1915,7 +1914,7 @@ stderr_logfile_backups=1 ...@@ -1915,7 +1914,7 @@ stderr_logfile_backups=1
# We test the XML report before sending it # We test the XML report before sending it
if self.validateXML(computer_consumption, computer_consumption_model): if self.validateXML(computer_consumption, computer_consumption_model):
self.logger.info('XML file generated by asXML is valid') self.logger.info('XML file generated by asXML is valid')
slap_computer_usage.reportUsage(computer_consumption) self.computer.reportUsage(computer_consumption)
else: else:
self.logger.info('XML file generated by asXML is not valid !') self.logger.info('XML file generated by asXML is not valid !')
raise ValueError('XML file generated by asXML is not valid !') raise ValueError('XML file generated by asXML is not valid !')
...@@ -1967,7 +1966,7 @@ stderr_logfile_backups=1 ...@@ -1967,7 +1966,7 @@ stderr_logfile_backups=1
self.slap.jio_api_connector.put({ self.slap.jio_api_connector.put({
"portal_type": "Software Instance", "portal_type": "Software Instance",
"reference": computer_partition.get("reference"), "reference": computer_partition.get("reference"),
"reported_state": "started" "reported_state": "stopped"
}) })
else: else:
computer_partition["slap_partition"].stopped() computer_partition["slap_partition"].stopped()
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment