class PredicateResult(Names): """ Predicate results. """ yes = NamedConstant() # Log this no = NamedConstant() # Don't log this maybe = NamedConstant() # No opinion
class ENGINE(Names): """Constants representing different ENGINE options """ NATIVE = NamedConstant() # what is configured INMEMORY = NamedConstant() # in memory SQLite PERSISTENT = NamedConstant() # persistent SQLite
class VolumeEndStateTypes(Names): """ Types of volume states to simulate. """ ERROR_STATE = NamedConstant() TRANSIT_STATE = NamedConstant() DESTINATION_STATE = NamedConstant()
class MISSION_STATUS(Names): """ Constants representing various mission status codes. """ NOT_LOADED = NamedConstant() LOADED = NamedConstant() PLAYING = NamedConstant()
class StepResult(Names): """ Constants representing the condition of a step's effect. """ SUCCESS = NamedConstant() """ The step was successful. """ RETRY = NamedConstant() """ Convergence should be retried later. """ LIMITED_RETRY = NamedConstant() """ Converge should be retried, but only a limited number of times. This is used when we're waiting for upstream resources to become available but aren't certain that they ever will be. """ FAILURE = NamedConstant() """
class MoreNamedLetters(Names): """ Some more letters, named. """ digamma = NamedConstant() zeta = NamedConstant()
class NamedLetters(Names): """ Some letters, named. """ alpha = NamedConstant() beta = NamedConstant()
class FieldName(Names): dn = NamedConstant() dn.description = u"distinguished name" memberDNs = NamedConstant() memberDNs.description = u"member DNs" memberDNs.multiValue = True
class States(Names): # The worker isn't attached, or is in the process of attaching. DETACHED = NamedConstant() # The worker is available to build: either attached, or a latent worker. AVAILABLE = NamedConstant() # The worker is building. BUILDING = NamedConstant()
class TestFieldName(Names): isAwesome = NamedConstant() isAwesome.description = u"is awesome" isAwesome.valueType = bool isCool = NamedConstant() isCool.description = u"is cool" isCool.valueType = bool
class Color(Names): """ Some colors. """ red = NamedConstant() green = NamedConstant() blue = NamedConstant() black = NamedConstant()
class VolumeOperations(Names): """ Supported EBS backend operations on a volume. """ CREATE = NamedConstant() ATTACH = NamedConstant() DETACH = NamedConstant() DESTROY = NamedConstant()
class PILOT_STATE(Names): """ Constants representing pilot states. """ IDLE = NamedConstant() SPAWNED = NamedConstant() IN_FLIGHT = NamedConstant() DEAD = NamedConstant()
class SESSION_STATE(Names): """ Constants representing Session States """ CONNECTING = NamedConstant() OPEN = NamedConstant() CLOSING = NamedConstant() CLOSED = NamedConstant()
class ProviderType(Names): """ Kinds of compute/storage cloud providers for which this module is able to build ``IBlockDeviceAPI`` providers. """ openstack = NamedConstant() aws = NamedConstant() rackspace = NamedConstant()
class Angles(Names): """ The types of angles. """ LATITUDE = NamedConstant() LONGITUDE = NamedConstant() HEADING = NamedConstant() VARIATION = NamedConstant()
class Directions(Names): """ The four cardinal directions (north, east, south, west). """ NORTH = NamedConstant() EAST = NamedConstant() SOUTH = NamedConstant() WEST = NamedConstant()
class VolumeAttachDataTypes(Names): """ Types of volume's attach data states to simulate. """ MISSING_ATTACH_DATA = NamedConstant() MISSING_INSTANCE_ID = NamedConstant() MISSING_DEVICE = NamedConstant() ATTACH_SUCCESS = NamedConstant() DETACH_SUCCESS = NamedConstant()
class METHOD(Names): """ A container for some named constants to use in unit tests for L{Names}. """ GET = NamedConstant() PUT = NamedConstant() POST = NamedConstant() DELETE = NamedConstant()
class Operand(Names): """ Contants for common operands. """ OR = NamedConstant() AND = NamedConstant() OR.description = u"or" AND.description = u"and"
class ConvergenceLoopOutputs(Names): """ Converence loop FSM outputs. """ # Store AMP client, desired configuration and cluster state for later # use: STORE_INFO = NamedConstant() # Start an iteration of the covergence loop: CONVERGE = NamedConstant()
class _CONTROLS(Names): """ Control frame specifiers. """ NORMAL = NamedConstant() CLOSE = NamedConstant() PING = NamedConstant() PONG = NamedConstant()
class ProtocolVersion(Names): """ L{ProtocolVersion} provides constants representing each version of the SSL/TLS protocol. """ SSLv2 = NamedConstant() SSLv3 = NamedConstant() TLSv1_0 = NamedConstant() TLSv1_1 = NamedConstant() TLSv1_2 = NamedConstant()
def test_nonequality(self): """ Two different L{NamedConstant} instances do not compare equal to each other. """ first = NamedConstant() first._realize(self.container, "bar", None) second = NamedConstant() second._realize(self.container, "bar", None) self.assertFalse(first == second) self.assertTrue(first != second)
class ConvergenceLoopStates(Names): """ Convergence loop FSM states. """ # The loop is stopped: STOPPED = NamedConstant() # Local state is being discovered and changes applied: CONVERGING = NamedConstant() # Local state is being converged, and once that is done we will # immediately stop: CONVERGING_STOPPING = NamedConstant()
def test_hash(self): """ Because two different L{NamedConstant} instances do not compare as equal to each other, they also have different hashes to avoid collisions when added to a C{dict} or C{set}. """ first = NamedConstant() first._realize(self.container, "bar", None) second = NamedConstant() second._realize(self.container, "bar", None) self.assertNotEqual(hash(first), hash(second))
class ClusterStatusOutputs(Names): """ Outputs of the cluster status state machine. """ # Store the AMP protocol instance connected to the server: STORE_CLIENT = NamedConstant() # Notify the convergence loop state machine of new cluster status: UPDATE_STATUS = NamedConstant() # Stop the convergence loop state machine: STOP = NamedConstant() # Disconnect the AMP client: DISCONNECT = NamedConstant()
class ClusterStatusStates(Names): """ States of the cluster status state machine. """ # The client is currently disconnected: DISCONNECTED = NamedConstant() # The client is connected, we don't know cluster status: IGNORANT = NamedConstant() # The client is connected and we know the cluster status: KNOWLEDGEABLE = NamedConstant() # The system is shut down: SHUTDOWN = NamedConstant()
class ClusterStatusInputs(Names): """ Inputs to the cluster status state machine. """ # The client has connected to the control service: CONNECTED_TO_CONTROL_SERVICE = NamedConstant() # A status update has been received from the control service: STATUS_UPDATE = NamedConstant() # THe client has disconnected from the control service: DISCONNECTED_FROM_CONTROL_SERVICE = NamedConstant() # The system is shutting down: SHUTDOWN = NamedConstant()
class ConvergenceLoopInputs(Names): """ Inputs for convergence loop FSM. """ # Updated references to latest AMP client, desired configuration and # cluster state: STATUS_UPDATE = NamedConstant() # Stop the convergence loop: STOP = NamedConstant() # Finished applying necessary changes to local state, a single # iteration of the convergence loop: ITERATION_DONE = NamedConstant()