If partition don't have enough information: it is free partition, just don't process it

parent d9d062e5
...@@ -611,6 +611,13 @@ class Slapgrid(object): ...@@ -611,6 +611,13 @@ class Slapgrid(object):
for computer_partition in self.getComputerPartitionList(): for computer_partition in self.getComputerPartitionList():
computer_partition_id = computer_partition.getId() computer_partition_id = computer_partition.getId()
try:
software_url = computer_partition.getSoftwareRelease().getURI()
# XXX should test status as well. But getState() returns default value.
except NotFoundError:
# No Software Release information: skip.
continue
# Check if we defined explicit list of partitions to process. # Check if we defined explicit list of partitions to process.
# If so, if current partition not in this list, skip. # If so, if current partition not in this list, skip.
if len(self.computer_partition_filter_list) > 0 and \ if len(self.computer_partition_filter_list) > 0 and \
...@@ -640,10 +647,7 @@ class Slapgrid(object): ...@@ -640,10 +647,7 @@ class Slapgrid(object):
os.remove(timestamp_path) os.remove(timestamp_path)
exception = traceback.format_exc() exception = traceback.format_exc()
logger.error(exception) logger.error(exception)
try:
software_url = computer_partition.getSoftwareRelease().getURI()
except NotFoundError:
software_url = None
software_path = os.path.join(self.software_root, software_path = os.path.join(self.software_root,
getSoftwareUrlHash(software_url)) getSoftwareUrlHash(software_url))
local_partition = Partition( local_partition = Partition(
......
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