예제 #1
0
def start(**kwargs):
    with update_storage(ctx) as data:
        machines = data.get('machines', {})
        ctx.send_event('starting machine event')
        ctx.logger.info('cloudmock start: [node_id={0}, machines={1}]'
                        .format(ctx.instance.id, machines))
        if ctx.instance.id not in machines:
            raise NonRecoverableError('machine with id [{0}] does not exist'
                                      .format(ctx.instance.id))
        machines[ctx.instance.id] = RUNNING
        ctx.instance.runtime_properties['id'] = ctx.instance.id
예제 #2
0
def start(**kwargs):
    with update_storage(ctx) as data:
        machines = data.get('machines', {})
        ctx.send_event('starting machine event')
        ctx.logger.info('cloudmock start: [node_id={0}, machines={1}]'
                        .format(ctx.instance.id, machines))
        if ctx.instance.id not in machines:
            raise NonRecoverableError('machine with id [{0}] does not exist'
                                      .format(ctx.instance.id))
        machines[ctx.instance.id] = RUNNING
        ctx.instance.runtime_properties['id'] = ctx.instance.id
예제 #3
0
def stopwf(**kwargs):
	config = ConfigParser.ConfigParser()
	buf = StringIO.StringIO(ctx.get_resource('orchestration.cfg'))
	config.readfp(buf)
	ctx.send_event(' -----node name-----> ' + ctx.node.name)
	VDC_NAME = ctx.node.properties[ctx.node.name]
	
	host = ctx.node.properties['host']
	definitionName = config.get('DECOMMISSION','definitionName')
	payload = config.get('DECOMMISSION','payload')
	payload = payload.replace("$VDC_NAME",VDC_NAME)

	ctx.send_event('running commissioning workflow -- host: ' + host + '   definition: ' + definitionName + '   vDC name: ' + VDC_NAME)
예제 #4
0
def start(**kwargs):
    data = _get_data()
    machines = data['machines']
    ctx.send_event('starting machine event')
    ctx.logger.info("cloudmock start: [node_id={0}, machines={1}]".format(
        ctx.node_id, machines))
    if ctx.node_id not in machines:
        raise RuntimeError("machine with id [{0}] does not exist"
                           .format(ctx.node_id))
    machines[ctx.node_id] = RUNNING
    ctx.runtime_properties['id'] = ctx.node_id
    if data['raise_exception_on_start']:
        raise RuntimeError('Exception raised from CloudMock.start()!')
    _store_data(data)
예제 #5
0
def start(**kwargs):
    data = _get_data()
    machines = data['machines']
    ctx.send_event('starting machine event')
    ctx.logger.info("cloudmock start: [node_id={0}, machines={1}]".format(
        ctx.node_id, machines))
    if ctx.node_id not in machines:
        raise RuntimeError("machine with id [{0}] does not exist".format(
            ctx.node_id))
    machines[ctx.node_id] = RUNNING
    ctx.runtime_properties['id'] = ctx.node_id
    if data['raise_exception_on_start']:
        raise RuntimeError('Exception raised from CloudMock.start()!')
    _store_data(data)