Commit 37482e7b authored by Guido Trotter's avatar Guido Trotter
Browse files

Make the OS object able to represent broken OSes

Till now the OS object just represents a correct OS instance.  Change it so it
can represent a broken one too, by adding a "status" field: if this field is
different from the OS_VALID_STATUS constant the object is considered to be an
invalid OS, the "status" field to be a debugging message, and its boolean
status is set to false.

Reviewed-By: iustinp
parent 519bfbae
......@@ -130,6 +130,9 @@ LOCALHOST_IP_ADDRESS = ""
# valid os status
# ssh constants
SSH_CONFIG_DIR = "/etc/ssh/"
......@@ -589,6 +589,7 @@ class OS(ConfigObject):
__slots__ = [
......@@ -596,6 +597,10 @@ class OS(ConfigObject):
def __nonzero__(self):
return self.status == constants.OS_VALID_STATUS
__bool__ = __nonzero__
class Node(TaggableObject):
"""Config object representing a node."""
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