src/droute53.py
def changeState(instanceObj, fx, desiredState, opStr):
    """
    Change the state of the instance.

    @param insanceObj: ec2.Instance -- Instance to be manipulated.
    @param fx: function -- function to execute to change state.  Takes
                no argument (e.g instanceObj.stop or instanceObj.start)
    @param desiredState: int -- The state to be achieved.
    @param opStr: str -- A string to reprsnting the operation to the,
                user (e.g. 'Starting' or 'Stopping')

    @return: None
    """
    # If it is changing state wait until the operation is complete.
    waitForState(instanceObj, [RUNNING, STOPPED])
    if instanceObj.state_code != desiredState:
        try:
            ident = instanceObj.tags['Name']
        except KeyError:
            ident = 'unknown'
        print('{} {}({}).'.format(opStr, ident, instanceObj.id))
        fx()
        waitForState(instanceObj, [desiredState])

    Change the state of the instance.

    @param insanceObj: ec2.Instance -- Instance to be manipulated.
    @param fx: function -- function to execute to change state.  Takes
                no argument (e.g instanceObj.stop or instanceObj.start)
    @param desiredState: int -- The state to be achieved.
    @param opStr: str -- A string to reprsnting the operation to the,
                user (e.g. 'Starting' or 'Stopping')

    @return: None
    
Change the state of the instance.
Change the state of the instance .
def changeState(instanceObj, fx, desiredState, opStr):
    waitForState(instanceObj, [RUNNING, STOPPED])
    if instanceObj.state_code != desiredState:
        try:
            ident = instanceObj.tags['Name']
        except KeyError:
            ident = 'unknown'
        print('{} {}({}).'.format(opStr, ident, instanceObj.id))
        fx()
        waitForState(instanceObj, [desiredState])
def changeState ( instanceObj , fx , desiredState , opStr ) : waitForState ( instanceObj , [ RUNNING , STOPPED ] ) if instanceObj . state_code != desiredState : try : ident = instanceObj . tags [ 'Name' ] except KeyError : ident = 'unknown' print ( '{} {}({}).' . format ( opStr , ident , instanceObj . id ) ) fx ( ) waitForState ( instanceObj , [ desiredState ] )
Change the state of the instance.
Change the state of the instance .
"""
    Change the state of the instance.

    @param insanceObj: ec2.Instance -- Instance to be manipulated.
    @param fx: function -- function to execute to change state.  Takes
                no argument (e.g instanceObj.stop or instanceObj.start)
    @param desiredState: int -- The state to be achieved.
    @param opStr: str -- A string to reprsnting the operation to the,
                user (e.g. 'Starting' or 'Stopping')

    @return: None
    """ # If it is changing state wait until the operation is complete.
None
instanceObj
fx
- function to execute to change state.  Takes
no argument
- function to execute to change state . Takes no argument
desiredState
- The state to be achieved.
- The state to be achieved .
opStr
- A string to reprsnting the operation to the,
user
- A string to reprsnting the operation to the user
insanceObj
ec2.Instance -- Instance to be manipulated.
ec2 . Instance -- Instance to be manipulated .