Ejemplo n.º 1
0
 def _create_node_instance_context(self):
     properties = {}
     properties['cloudify_agent'] = self._create_agent()
     properties['agent_status'] = {'agent_alive_crossbroker': True}
     mock = mocks.MockCloudifyContext(
         node_id='host_af231',
         runtime_properties=properties,
         node_name='host',
         properties={'cloudify_agent': {}},
         bootstrap_context=context.BootstrapContext({'cloudify_agent': {}}))
     return mock
Ejemplo n.º 2
0
    def _set_context(self, host='localhost'):
        old_context = ctx
        try:
            os.environ[constants.MANAGER_FILE_SERVER_ROOT_KEY] = \
                self.temp_folder

            properties = {}
            properties['cloudify_agent'] = self._create_agent()
            properties['agent_status'] = {'agent_alive_crossbroker': True}
            mock = mocks.MockCloudifyContext(
                node_id='host_af231',
                runtime_properties=properties,
                node_name='host',
                properties={'cloudify_agent': {}},
                bootstrap_context=context.BootstrapContext({
                    'cloudify_agent': {'networks': {'default': host}}}))
            current_ctx.set(mock)
            yield
        finally:
            current_ctx.set(old_context)